Skip to content

Fix unresolvable jit_arm64 import; export vsa_jit so the compiler looks - #98

Merged
gHashTag merged 1 commit into
mainfrom
fix-jit-import
Aug 11, 2026
Merged

Fix unresolvable jit_arm64 import; export vsa_jit so the compiler looks#98
gHashTag merged 1 commit into
mainfrom
fix-jit-import

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

What was wrong

src/vm/jit_unified.zig imported the ARM64 backend as "../../jit_arm64.zig".
From src/vm/, that path escapes the module root, so it could not resolve on
any machine, ever. The file it wants — jit_arm64.zig — sits in the same
directory
, right next to it.

Why six weeks of green CI never noticed

Nothing exported vsa_jit. Zig analyses a top-level declaration only when
something references it, so an unreferenced @import of an unresolvable path
is not an error — it is simply never looked at. No export, no reference, no
analysis, no error. The build stayed green because the compiler was never
asked the question.

Measured, before and after, with the file compiled directly:

$ zig build-obj src/vsa_jit.zig -femit-bin=/dev/null      # before
src/vm/jit_unified.zig:13:23: error: import of file outside module path
const arm64 = @import("../../jit_arm64.zig");

$ zig build-obj src/vsa_jit.zig -femit-bin=/dev/null      # after
(clean)

The change

Two lines: the import path, and a pub const vsa_jit in root.zig so the
compiler is forced to look from now on. The export is the durable half — the
path fix without it would rot again the same way.

zig build clean, 163/163 tests passed. The one remaining failure on my
local toolchain is testing.refAllDeclsRecursive, removed in Zig 0.16; it is
present at baseline without this change (verified by stash) and CI targets
0.15.2, where it exists.

Not fixed here, but worth knowing

This file exists five times across the fleet: twice in this repository
(src/vsa_jit.zig and src/vm/vsa_jit.zig, byte-identical apart from the
relative import paths), once in zig-hdc, once in trinity. The trinity copy is
stale — it still calls the old 2-argument dotProduct. The zig-hdc copy calls
a 3-argument version that exists nowhere. That divergence is the direct
consequence of the duplication, and it is a separate change.

The path escaped the module root; the file was in the same directory.
Nothing exported vsa_jit, so nothing ever compiled it, so nobody found out.
@gHashTag
gHashTag merged commit ff84ec6 into main Aug 11, 2026
5 of 7 checks passed
@gHashTag
gHashTag deleted the fix-jit-import branch August 11, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant