You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: close vm.zig scattered gaps: assert message formatting, mixed-type comparisons, named-map field predicates, heap-struct IC paths (95.92% -> 96.07%)
Adds 12 native compiler_test.zig tests targeting scattered single/
double-line vm.zig gaps identified via a fresh coverage sweep:
- panicMessageFromValue's bool/float arms (`assert cond, msg` panic
message formatting for non-string/int msg values).
- namedTypeCommonAncestor's loop back-edge, via a 3-level named-string
type hierarchy where the shared ancestor is one level past the
first check.
- compareNumericPair's second non-finite check (mixed plain int +
NaN float, only reachable via any-erasure) and
checkNamedValueCompatibility's mixed named/plain branch (a named
string compared against null, and against an unrelated plain
string) — two more paths that need a genuinely *boxed* named type
per this session's round-8 finding (named ints/floats erase to bare
values and never reach these checks).
- performCall's .variant_ctor case: calling a variant constructor as
a first-class value with a payload type mismatch.
- opSetIndex's bracket-assignment (`s["field"] = val`) arms for both
struct representations (small inline vs. heap-backed >4-field).
- checkFieldNamedTypePredicate: re-validates a struct field's named-
type predicate when the incoming value is any-erased (bypassing the
construction-time check a direct Type(...) call would have already
done).
- opGetLocalGetField's and opInvokeMethod's inline-cache paths for a
heap-backed (>4-field) struct receiver — both had only small-struct
coverage before.
- int_div's plain-float and mixed-int/float carrier paths (division-
by-zero on both checks, the overflow check, and the success path),
plus rem's plain-float zero-divisor check.
- mul's decimal*plain-int-scalar success path.
Also found (documented in memory, not fixed — the assertions are
still correct either way): two PRE-EXISTING tests, one from a prior
session and one from this session's own round 8, use a named-int type
(e.g. Big(...)) intending to exercise int_div's *carrier* fallback
path, but named ints erase to bare values on construction (per the
round-8 finding), so both actually exercise the ordinary int/int fast
path's own checks instead — same correct error, different code path
than the comment claims. Not worth correcting the comments; the
now-added carrier-path tests above use genuinely mixed int+float
operands instead, which is the only way to force that fallback.
vm.zig: 90.10% -> 91.81%. Overall: 95.92% -> 96.07%. Test count 977 -> 989.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C3pMYWS2xy8zitUkpJaiZU
0 commit comments