ReviewOS

zig-utils/zig-js

VM: coerce each class computed key before evaluating the next key

#819
Closed chris opened this 9 days ago ·
9 days ago

Parent: #465. Related: #814 and the remaining #806 class witnesses. Reproduced independently on main 6bb4b77 with the retained ReleaseSafe baseline runner.

A generator executing var log="",key={toString(){log+="a";return "a";}}; class C{[key](){}[(log+="b","b")](){}} return log; returns ba; Node 24.18.0 and system JSC return ab. A native forced-tree/required-bytecode witness passes the tree walk and fails required bytecode. Raw evidence: /Users/chris/.cache/zig-js-class-name.mw5loL/before-class-key-order.log.

The compiler currently evaluates all class key expressions in compileClassComputedKeys, while buildClass performs their ToPropertyKey conversions later. ClassElementEvaluation requires each key conversion to complete before the next key expression, with abrupt completion preventing later effects. Fix this exact ordering through normal bytecode/native lowering; preserve suspension, precise roots and private-name environments. Cover String/Symbol keys, once-only coercion, throwing coercion, heritage ordering and moving-GC/OOM paths. This is distinct from passing an inferred class name before static effects (#814); do not change stack, queue, job or lifecycle implementations.

9 days ago

The candidate now canonicalizes each computed key immediately after evaluating it, before evaluating the next element name. The 12 local semantic assertions improve 2/12 -> 12/12 in automatic execution and 0/12 -> 12/12 in forced-tree/required-bytecode pairs, including abrupt coercion, Symbols, heritage ordering, yield and await. Node agrees with 11/12 and system JSC with 12/12; the heritage assertion follows the specification where Node differs.

The complete positive class census is unchanged: expressions 3448/3448 and statements 3706/3712 in forced-tier pairs; zero upstream flips and zero measured regressions. The six existing statement failures are the five private-name witnesses and default-constructor-2, not hidden by this change. Negative fixtures are outside this positive denominator.

Six of seven initial focused Debug tests passed. Fault-injection exposed a broader non-suspendable program environment cleanup defect, now tracked separately as #820. That is being fixed and revalidated before #819 lands. No native stack/queue/job lifecycle redesign.

9 days ago

Pushed fix(class): coerce computed keys before later elements (#819), following the separate program-exit cleanup fix (#820). Both commits use Chris as author/committer and have no coauthor trailers.

Final corpus results match the earlier measured candidate: 12/12 local semantics and 12/12 forced-tier pairs; default class corpus 8426/8426; positive forced-tier class census 7154/7160, unchanged six pre-existing failures and zero measured regressions. Final Debug fuzz passes 400 default plus 300 verifier programs from seed 1 with zero failures. The native 2148-test full Debug run is now running after corpus/fuzz completion.

Combined-main CI 33209229291 is pending. The preceding run is superseded, not a completed green matrix. Keeping this issue open until terminal integration evidence is available.

9 days ago

Terminal full local Debug result for exact pushed 4f7718d: 2147 passed, one platform skip, zero failures and leaks; all 2148 linked tests ran across four native shards, 743.9s wall. The immutable binary, source hash, scheduling plan and per-shard logs are retained. This covers #820 and the earlier class-name/descriptor/metadata fixes as integrated, before the uncommitted #821 candidate.

Current CI is not green: #722 recurred in nogil-corpus-functional shard 1/4 with the unchanged mc-lock-stop-vs-park expected-400/got-401 assertion. Its exact completed job log and run are now linked on #722. Other matrix jobs are still running.

9 days ago

Closing with terminal combined-main integration evidence: CI 33211154123 at e24c4fa completed successfully: 53 successful checks, one skipped nightly-only check, zero failed/cancelled checks. The implementation fix(class): coerce computed keys before later elements (#819) is in that revision. This completes the pending integration condition alongside the scoped local/conformance evidence recorded above. Separately discovered Error-intrinsic, Array-realm, prototype-type and restriction-path defects remain open in #823, #824, #825 and #826; this closure does not claim those are fixed.

Sign in to comment on this issue.