The Phase 4 bug hunt: random component programs, an independent model
of what they should leave, and the regression programs of what they
found. The production fixes they found are the commits before this one,
each with its regression programs; this commit holds the test harness,
the rest of the tests and the memories they grew with. A regression
program that needs the harness runs once this commit is in.
- Generation (composable gen): worlds of components, nested copies,
variants, libraries (stale and dependent), flex and grid layouts and
texts; operations for structure, geometry, styles, texts, layout items,
grid tracks and cells, swaps, variant switches, update main, reset,
detach, library edits and syncs, undo and redo; shrinking, coverage
accounting per operation kind, and PENPOT_GEN_SEED, PENPOT_GEN_NUM
and PENPOT_GEN_HISTORIES to choose the seed, the number of programs
and their length.
- The oracle: invariants on touched groups, overrides, refs, settled
versus full sync, design snapshots and the model values, with its
own model of authored intent (shadow, geometry, grid and variant
rules) instead of production's results.
- The frontend replays generated programs through the workspace events
and the completion contract, with undo and redo checks.
- The oracle unit tests, the test runners' registrations, the golden
masters recorded again where a fix changed them, and the memories of
the component sync contract and its tests.
Harness only; the benchmark is not run.
Also in this commit:
- Adapt develop's variant set and reload tests to this branch. Develop's tests
of transforming a component into a variant set call the event with the set's
id and expect the defining commit to hold only the main. Here the transform
builds the whole set, its second member included, in one commit:
transform-in-variant takes an optional variant id, and the tests expect both
members in that commit.
- Restore the requires and test wiring the rebase merges dropped.
- Generate variant property edits and added variants. The random programs
switched between the members of a variant set but never changed the set.
AI-assisted-by: claude-opus-5-5
A grid without a direction assigned children column-first and grew rows,
while grid creation, the direction event, the WASM renderer and CSS export
read it as a row grid. The library file builder decodes the direction as
optional, so imported files can lack it. Picking "column" on such a grid
then swapped auto-placed children.
Add grid-direction, which defaults to row, and use it for cell order, track
growth, track fitting and the direction event. The generated oracle predicts
the same flow order.
The builder regressions fail three of six assertions before the fix; the
real-event component regression fails six of 293, with main and copies
grown to 3x2 instead of 2x3. Both pass unchanged after the fix, including
exact undo and redo. The fitting flow-order control's missing-direction case
now expects row order.
Full frontend passes 1798 tests / 15737 assertions; common JVM passes
2052 / 33613. Backend passes 1838 / 9293; exporter passes 16 / 40. Lint
and formatting pass for common, backend and exporter; frontend lint and
changed-file formatting pass. Common JavaScript fails only in two random-seed
component properties. Both shrunk programs fail the same way without this
change and are fixed separately.
Compare lower-quantile milliseconds with the saved baseline; keep that
baseline unchanged. The machine/JVM warning makes ratios rough. No world
is flagged.
World Baseline Now Ratio
Main into 10 copies 1.790 0.961 0.54
Main into 100 copies 15.415 8.816 0.57
Main into 1000 copies 153.086 94.309 0.62
Three nesting levels 35.215 19.435 0.55
Dependency chain 68.931 37.850 0.55
Library update 83.083 45.747 0.55
Many plain shapes 4.837 2.153 0.45
Variant switch 32.052 20.254 0.63
AI-assisted-by: claude-opus-5-5
Create default cells in newly inherited grid tracks before assigning
added copy children. A cell override previously made sync append an extra
track; a later full sync shrank the tracks beneath the retained cells.
Keep existing authored cells and skip positions covered by existing spans.
Add common and real frontend row/column growth histories, including an
opposite copy direction, retained overrides, exact undo/redo and stable
full sync. The original common test failed 12 of 100 assertions and the
frontend test failed 4 of 100. Keep those assertions and add checks that
each child has exactly one cell.
Sync benchmark lower quantiles (ms), baseline -> now (ratio):
deepest three levels: 35.215 -> 18.770 (0.53)
chain of dependents: 68.931 -> 37.764 (0.55)
library update: 83.083 -> 49.418 (0.59)
main among many shapes: 4.837 -> 3.008 (0.62)
main into 10 copies: 1.790 -> 0.968 (0.54)
main into 100 copies: 15.415 -> 9.474 (0.61)
main into 1000 copies: 153.086 -> 97.063 (0.63)
variant switch: 32.052 -> 22.157 (0.69)
All worlds pass the recorded 10% regression limit. The baseline used
another machine/JVM, so ratios are rough comparisons.
Validation: common JVM 2,016 tests / 33,356 assertions; common JS
1,952 / 32,015; frontend 1,752 / 14,088; backend 1,793 / 9,007;
exporter 16 / 40. Six properties pass 40 programs at seed 712 in
both common runtimes. Lint and format checks pass for all four modules.
Golden-master data is unchanged.
AI-assisted-by: gpt-6