ReviewOS

home-lang/home

Bun parity: complete YAML parser and stringify contracts beyond block scalars

#757
Closed chris opened this 10 days ago ·
10 days ago

Parent tracker: #66. Follow-up to completed block-scalar work in #737, #708, and #711.

Completed on Darwin in 801e8f84b5e633e5cc0fa9eecf119d7ef6ae4c6c, using the 3 unchanged files from Bun pin 4982b91e3702094330f3be3883354c52b8c01323:

  • Home baseline: 1,911 pass / 23 upstream TODO / 180 fail / 14 snapshots / 12,939 assertions.
  • First checkpoint 9c4dca881: 2,047 pass / 23 upstream TODO / 44 fail / 14 snapshots / 13,053 assertions.
  • Completed Home result: 2,091 pass / 23 upstream TODO / 0 fail / 14 snapshots / 13,198 assertions.
  • Pinned Bun control: 2,091 pass / 23 upstream TODO / 0 fail / 14 snapshots / 13,198 assertions.

Exact files:

  • test/js/bun/yaml/yaml-block-scalar-matrix.test.ts
  • test/js/bun/yaml/yaml-test-suite.test.ts
  • test/js/bun/yaml/yaml.test.ts

The final native Zig port covers BOM and line-start tracking, Core-schema numbers, block scalar folding and indentation, explicit and implicit keys, flow pairs and JSON-style keys, tag/anchor ownership on empty nodes, tab-taint propagation, document boundaries, bounded alias expansion, indexed and bounded merge materialization, and safe collision-free stringify anchor names. Parse, import-loader, and stringify paths remain in Home's native implementation; no fixture, deadline, assertion, snapshot, skip, or TODO was changed.

Verification:

  • focused final regressions: 21 pass / 0 fail / 123 assertions;
  • exact full YAML tranche: 2,091 pass / 23 upstream TODO / 0 fail / 14 snapshots / 13,198 assertions;
  • deadline-sensitive alias/merge safety tests: pass in roughly 65–104 ms;
  • ReleaseFast JSC build: 46/46 steps, bounded peak 14,344 MB under the 15,360 MB ceiling;
  • commit authored and committed as Chris Breuer without coauthors and pushed to origin/main.

The 23 TODOs are the same upstream TODO cases in the pinned Bun control and are intentionally preserved as TODOs.

10 days ago

Pushed 9c4dca8813b03dd68aa0a98d449818170f0bb89d (fix(runtime): port modern YAML parser contracts) to origin/main.

This is a direct port of current pinned Bun parser behavior into Home's native Zig parser: BOM/line-start state, core-schema numeric validation, tab-taint tracking, shared block-indented dispatch, explicit-key boundaries, flow pair/separator guards, bounded alias expansion, and hash-indexed bounded merge materialization.

Exact unchanged 3-file Darwin YAML tranche:

  • before: 1,911 pass / 23 TODO / 180 fail / 14 snapshots / 12,939 assertions
  • now: 2,047 pass / 23 TODO / 44 fail / 14 snapshots / 13,053 assertions
  • pinned Bun: 2,091 pass / 23 TODO / 0 fail / 14 snapshots / 13,198 assertions

The three adversarial alias/merge safety cases pass in about 65–104 ms. ReleaseFast JSC build: 46/46 steps, bounded peak 14,344 MB under the 15,360 MB ceiling.

Remaining failures are now concentrated in flow-context explicit pairs/JSON keys, e-node property ownership, five tab edge cases, document-end-at-EOF/quoted-marker behavior, six yaml-test-suite cases, four stringify anchor roundtrips, and one pending-whitespace/document-end case.

10 days ago

Completed and pushed 801e8f84b5e633e5cc0fa9eecf119d7ef6ae4c6c (fix(runtime): complete YAML parser parity) to origin/main.

The exact unchanged three-file YAML tranche now matches pinned Bun:

  • 2,091 pass / 23 upstream TODO / 0 fail
  • 14 snapshots / 13,198 assertions

The final 21-case regression filter passes with 123 assertions, including DK95/06, FRK4, flow pairs, multiline JSON keys, tab-indentation boundaries, and stringify anchor safety/collisions. The ReleaseFast JSC build passes 46/46 steps with a bounded 14,344 MB peak under the 15,360 MB ceiling.

This closes the YAML parser/stringifier parity tranche. The 23 TODOs are identical to the pinned Bun control.

Sign in to comment on this issue.