GPU Scene Optional Repeat Selected Contract - barocss/barocss GitHub Wiki
#1494
Selected GPU contract: optional finite Scene repeats
Owner Execute GPU; READY CPU source implementation. Exact currently accepted parent f275e19c198bfce154b9144444c6e836ee38d992. Genuine provider #1476 adopted3833ded7 (receipt6106021386) plus current typed arithmetic/affine lowerer; #1482 exists at447ba55d. Native #1488 e33c1a1b has been handed once, adoption is pending and is NOT a dependency of this repeat-only source stage. No joint-generation union, consumer, GL or held-role availability is inferred. Sole Integration remains serial adopter and reconciles any later same-leaf native deltas.
Maintained need and existing-capability/duplicate checks
Maintained GPU finite generation roadmap originally proposes0..32; delivered1476 and1488 narrowly admit1..32. The useful scenario edits only a finite row's count2 -> 0 -> 3 while retaining a complete original source declaration and type styles. NEW public emitted controls in evidence-scene-optional-repeat-gpu/existing-control.{mjs,json,log} admit manual2/0/3 scenes, refuse repeat0 SYNTAX, reject invalid unmatched radius/scale SCENE, admit empty torus with individually valid major1/minor2, and reject that relationship when a torus exists. Manual removal is available; it does not retain the direct repeat-count relationship. No universal missing generation or renderer capability claimed. Read-only helper all-state zero/optional/count titles and zero-count/optional-repeat searches, recent100 Issues and actual1476/1488 cards found no owned optional-zero card. Existing1476/1488 stay intact. Minimum added capability: an explicit repeat-only source profile admitting canonical zero.
Exact API, schema, source and units
Add compileOptionalRepeatedAffineSceneSource(input:unknown):CompiledOptionalRepeatedAffineSceneSource. Add only two public types OptionalRepeatedAffineSceneAst and CompiledOptionalRepeatedAffineSceneSource; reuse existing SceneRepeatDeclaration/SceneGenerationRecord/SceneParameter and SceneParameterSourceError. No new error/validator/parser/exported internal helper.
Input primitive complete original Source2 string only. No coercion/AST/overrides/callbacks/runtime generation. Result exact9 fields format:'barocss-gpu-optional-repeat-affine-scene-source',version0,profile:'source2-typed-optional-repeat-coefficients-v0',source,ast,parameters,generation,scene,shaders. AST exact9 original structural fields with schema:'barocss-gpu-optional-repeat-affine-scene-ast',schemaVersion0,sourceVersion2, declarations original headers/parameters/explicit objects/repeat declarations, all original rules and UTF16 tokens. Reuse arithmetic coefficients and quantity rules: scalar dimensionless, length scene, angle explicit deg, finite bounds1000/1000/360. Original strings/signs/ranges versus canonical Number/derived shader Float32 are separate. No CAD mm/F64/control/UV/native IDs/frame/native-file authority.
Only @repeat PREFIX:SHAPE(COUNT); in the existing object phase. ASCII prefix1..32 and six existing shapes. COUNT exactly 0 or positive canonical decimal digits1..32; refuse00/02/+0/-0/fraction/exponent/nonfinite/reference/computed forms, never floor/clamp. At most8 declarations, including zeros; total explicit+sum counts<=32. No conditions/mixed grammar/body/index/nesting/else/runtime/parameter count. Both outside-scene repeat placement and parameter-after-repeat refuse local original-range SYNTAX in this new entry.
Zero identity, ordering, validation and ownership
Zero retains its authored declaration/tokens/range and participates in duplicate-prefix checks and declaration/work limits. It creates NO generated object, ID, token or generation record and reserves NO nonexistent ID. Therefore an explicit #row_0 may coexist with @repeat row:sphere(0), but stale #row_0 style without an actual object is actual delegated unknown-ID SCENE, not silently removed. Positive siblings preserve prefix_index IDs and original interleaved declaration order; edits0/2/3 do not renumber surviving sibling/explicit objects. Eight all-zero repeats can coexist with32 explicit objects, subject to usual limits.
Validate every declaration/shape and every global style field/reference/type/arity/finite range/Float32 and affine scale even when zero or unmatched. Reuse genuine unchanged lowerer once. Capsule/torus/rounded-box cross-field instance relationships apply only when an actual object exists; zero does not fabricate a candidate to claim template validation. Empty torus major1/minor2 admits, count1 refuses real relationship. No loop body or zero-instance relational validator provided. Unknown/stale ID rules always refuse; all authored rules retained.
Fresh ordinary recursively copied/frozen independent graphs across fields/calls. Retain whole original source rather than expanded Scene as authority. No input mutation/freezing/cache/getter. generation records reuse exact4 fields nodeId,prefix,index,declaration only for actual generated objects; no zero marker record. No new document persistence format.
Work, errors and compatibility
Add private 'optional-repeat' overload returning existing FiniteRepeatSceneData. Old public entries/signatures/types/schemas/grammar/refusals remain unchanged, including repeat0 refusal in compileFiniteRepeatAffineSceneSource and compileGeneratedAffineSceneSource when actually available. Internal declarations may add the overload; do not claim whole internal DTS byte equality. Original kernels/scene-front/affine lowerer/renderer/Material/package manifest preserved.
Work cap4096: B +4P +10R +4G +U +existing calc authored-token correction/+3 expression nodes. B original masked base AST nodes; P parameters; R all repeats including0; G sum actual counts; U every original coefficient reference use. Preflight counts/identity/work and all style/reference/calculation work before generated object/provenance copies in the NEW mode. Charge zero declaration10 and expansion0. No second lowerer or conditional active-view work. Source UTF16/UTF8<=64KiB, scan tokens65536, P16, references1536, rules128, fields512, generated+explicit32. Trusted shaders each64KiB, complete signed result2MiB UTF16/UTF8 before final copy/freeze. Actual scalar/semantic ranges remain existing authority.
Independent STATIC expected zero work fixture: version2nodes +128 rules +512 translate fields*(1+3 literal nodes) +8parameterwork +1536reference uses +10zero-repeat =3732. Replacing a translate:$extent $extent $extent by translate:calc($extent * $gain) $extent 0 preserves3uses, adds5original-token correction+3expression=8.45 replacements4092 admit;46 replacements4100 refuse before generated copies. Both below source64KiB and at genuine128rules/512fields/1536uses. This expectation is not an executed result yet.
Use SceneParameterSourceError INPUT/SYNTAX/TYPE/RANGE/BUDGET/SCENE, bounded six-field diagnostics with original UTF16 half-open0/LFlinecolumn1/CRLFsurrogates retained. Local errors have no fabricated cause; unchanged semantic/kernel errors retain actual SceneError cause. Original scan order governs syntax/prefix limits, generated identity before coefficient resolution, all reference/work admission before real lowerer. No old refusal widening.
Exact isolated ownership and ONE acceptance
Exactly five paths: Root packages/barocss-gpu/src/scene-parameter-source.ts, additive src/index.ts and README.md; helper1 NEW src/scene-optional-repeat-source.ts wrapper/types only; helper2 NEW examples/gpu-scene/scene-optional-repeat-flow.mjs only; helper3 independent private static review only. Root owns final gates/clean commit/evidence. No concurrent file writes, shared Integration/root/lock/policy/manifest/front/lowerer/kernel/consumer edits or new permanent Work. Preserve others, held roles, paused629/Release0.12.2, original52215 histories/user scenes/render-kiosk.
Affected GPU build -> syntax -> ONE source+emitted/DTS/manual exact Scene2+shader/original AST/ranges/provenance/full-file/cold flow. Edit2 ->0 ->3 with valid type rules and compare independent manual counterparts; verify no phantom IDs/records, original signed/CRLF/Unicode source, independent fresh frozen graphs, six zero shape declarations, explicit same nonexistent ID, interleaving, eight zeros/32 explicit and max32. Refuse stale zero-ID selector, invalid zero shape/style/scale/reference, duplicatezero prefix, malformed count/33/ninth/expanded33, unsupported condition/body/index/nesting/late parameter, actual positive torus/capsule/rounded-box relationships, old entries' zero, primitive getter0, source cap and exact4092/4100work. Genuine child reads complete original files through actual entry; saved AST/Scene/results are observations only. Retain admitted original/results/shaders after all refusals. No broad old campaign, browser/GL/frame/TEN/lifetime/consumer/history/native-file/publication assertion.
Record exact clean parent/head/modes/blobs/first build/syntax/ONE flow results/first failures/repairs/support limits in Issue and Wiki; immutable once-only sole Integration handoff; continue next owned task. Integration adoption/consumer/presentation/publication stages separate. No feature merge/product push/PR/npm/deploy/release.
Actual parent reconciliation before core and gates
Integration delivered and actual read-only five-blob audit confirms #1488 adoption4dcb0ebb67ac25f94a9f9e0b84d921f54ab468e8. The isolated1494 checkout fast-forwarded f275e19cā4dcb0ebb before core edits/build/flow. New wrapper is isolated and unchanged by the fast-forward. Effective exact clean native parent is now4dcb0ebb; initial1494 freeze/actual initial ready repeat-only dependencies above remain historical. All old mixed public APIs/types/schemas/refusals must now remain intact, namespace140+one=141. Source API/syntax/DTO/work/zero relationship policy/five-path ownership unchanged. This avoids overlapping serial native edits against an outdated accepted GPU leaf; no fake waiting dependency is created.
ONE qualifier additionally admits count1 with45product replacements at exact4096, and refusescount2 samecoefficients at4100. Zero45/46 retains4092/4100. These remain static expectations until actual first flow.
Native #1494 completion and immutable handoff
#1494 receipt6106441227: clean4dcb0ebb67ac25f94a9f9e0b84d921f54ab468e8 -> 3bf23cc106097fd53522d0f5a09674e65bda5f1e, exactlyfive frozen paths/371insertions13deletions. FIRST GPU build0/1019.2KiB, FIRST syntax0, ONE FIRST source/emitted/DTS/manual/original AST/provenance/full-file/cold flow0. Actual26 admissions/76refusals/getters0/141runtime names/twonewtypes/26genuine cold reconstructions. Whole result156958bytes SHA25605cb7beb970ca0f65e5134edb63b22c6ed096866fb46dc58bb63246ee0a6bcb2. No executed gate failure/product gate repair/flowretry. Helper avoided an authoring filename collision before gates; private review found no blocker. Root plus three helpers used disjoint ownership and root owned all final evidence.
New optional-repeat source0..32 retains zero authored declaration/work but NOgeneratedobjects/IDs/provenance; explicit realrow_0coexists/stalezero selector refuses; duplicates/eightzero/32real/interleaving/CRLFsigns/freshimmutablegraphs and oldpositive/mixed source/type/profile compatibility pass. Unmatchedindividualfield/range/reference/scale checks execute; genuine torus/capsule/roundedcrossrelations apply ONLYactualinstances, zero creates no phantomvalidationcandidate. New work3732+4G+8k genuinely proveszero45=4092admit/zero46=4100refuse/count1k45 EXACT4096admit/count2k45=4100refuse;1536uses retained. ONE lowerer is static pipeline contract, not runtime instrumentation. Validwhole2MiB/shader64KiBoverflow unforced.
Immutable manifest /Users/user/.barocss-ai/v3/evidence-scene-optional-repeat-gpu/immutable-handoff.{json,md} and once-only handoff delivered to sole Integration. Native source/API/file/cold COMPLETE; adoption pending until actual receipt. Noactiveconsumerselected, heldrolesnotwoken. GL/frame/TEN/nativefiles/history/currentRoot/publication remain separate. No oldproducer gate replay/productpush/PR/deploy/release. Root immediately deepens compiler-only Material discrete-selection readiness using genuine existing controls and explicitrecursiveIR/error/copy/budget/proof boundaries.
Actual code adoption of optional repeats
Sole Integration adopted #1494 at cc3f3f741d154f407e5f1f245cc8d2682a2f0add. Root's read-only audit6106473174 confirms all five paths, modes and blobs match native3bf23cc1. The saved native result156958bytes/hash is unchanged. No native gate was replayed and the immutable delta was not sent again. CPU source/API is now available; GL/frame/TEN, consumer dispatch, native documents/history, currentRoot and publication remain separate. Earlier native/adoption-pending checkpoints are historical.