ReviewOS

zig-utils/zig-js

VM: remove legacy four-property loop body kernel

#1076
Closed chris opened this 8 days ago ·
8 days ago

Parent: #498 Related: #1074, #491

The current inventory labels the four-property counted-loop path as legacy_pattern_kernel / legacy_narrow. It recognizes one exact 38-bytecode body and batches four property mutations and loop control, backed by a per-instruction Chunk plan table. This conflicts with the no body/benchmark recognizer constraint.

Executed baseline: the existing kernel-hit witness passes 2/2, explicitly asserting hits in isolated and synchronized modes. Both runs return 28,093,728 and report exactly 379 logical steps; the accessor counterpart observes nine operations.

Acceptance:

  • Remove the exact recognizer/executor, plan/update types, per-instruction kernel table allocation, and hit metric; retain general opcode caches and bounded per-assignment traces.
  • Ordinary four-property execution retains result 28,093,728, 379 steps, property order, accessor/Proxy effects, and synchronization semantics.
  • Checkpoints, GC, debugger/profiler, termination, budgets, OOM, and actual no-GIL cases remain covered.
  • Focused normal/ReleaseSafe/unsuppressed TSan tests and exact before/after affected corpus/VM comparisons show no new failures.
  • Remove live kernel inventory coverage, regenerate docs/manifest, and keep historical artifacts intact with remaining legacy work explicit.

This deletes body-specific work substitution; it is not a no-JIT throughput claim or completion of the broader #498 roadmap.

8 days ago

Landed in c061420f.

Removed the exact 38-bytecode recognizer/executor, kernel plan/update types, per-instruction plan table allocation, and hit metric. General opcode caches and bounded per-assignment traces remain. Shared execution uses ordinary synchronized property opcodes.

Validation:

  • Both synchronization modes retain result 28,093,728 and 379 steps; the accessor counterpart retains nine operations.
  • Execution group 5/5 in normal, ReleaseSafe, and unsuppressed TSan covers actual four-worker no-GIL execution, Proxy/GC trap ordering confirmed against Node, budget/stop checkpoints, and the original result/step witness.
  • Source hooks 2/2 in each of those modes: the VM profiler and supported tree-walker debugger each observe all 32 property-update statements.
  • Expanded activation allocation-failure test 2/2; retained assignment-trace and unsupported-cache tests 2/2 each.
  • Exact parent/after diagnostic and tree/required-VM comparisons: while 38, for 385, assignment 485, addition 48, and Object 3,411 — 4,367 total, 0 failures before → 0 failures after, 0 flipped cases. The same five tail-call differences remain (tco-body.js and the four for/tco-{lhs,var,let,const}-body.js cases); each passes in the VM and fails in the tree walker on both binaries.
  • Inventory self-test and validation pass: 14 guarded families, 6 remaining legacy families, 5 explicit unsupported families. Docs links pass for 378 files and the 51-page build matches the refreshed manifest.

These are scoped semantic and documentation checks. Full integration gates run in CI. Historical performance artifacts remain intact; this removal is not current throughput evidence or completion of #498.

Sign in to comment on this issue.