Skip to content

tests: test-metal-residency-owners-host builds and passes again - #4987

Open
ashhart wants to merge 6 commits into
mainfrom
lead/residency-owners-test
Open

ashhart wants to merge 6 commits into
mainfrom
lead/residency-owners-test

Conversation

@ashhart

@ashhart ashhart commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

zig build test-metal-residency-owners-host stopped working on main. Two separate problems caused it:

  1. It didn't compile. checkpoint_metal.zig now reaches safetensors and checkpoint_file_cache through core. In this step, core is the test root zig/residency_owner_tests.zig, and that root exported neither module. It now exports both, the same way zig/qwen27_core.zig already does.
  2. Once it compiled, one test crashed. The Qwen27 fixture declares its draft model as undefined and then sets the backend's fields one at a time. It never set attention_full, so the optional's = null default did not apply. appendDraft then listed a buffer whose contents were garbage. The fixture now sets attention_full = null, which is what a real backend gets from init when the draft has no v1 full layer. The residency owner code itself was correct.

Only test code changes. No behaviour or output tokens change.

Checks: the step fails on main before this change and passes with it. fmt and git diff --check are clean, and the line caps and gradient-serving pins hold.

Two more steps that were broken on main, fixed in the same way:

  1. test-qwen27 didn't compile. Since the MTP draft-pick change, qwen27/mtp_pick.zig imports bf16_topk, but the qwen27 module in zig/build/qwen27.zig was never given that import. It now gets it, the same way qwen_core and the engine already do.
  2. compile-metal-residency-host and test-slide-metal-host didn't compile on macOS. native/inkling2.zig, reached through the engine, imports engine_api, but the shared macOS host engine in build.zig had no such module. The engine now has one engine_api module. The host steps that import it too (residency_host.zig, slide_host.zig, flashnext_budget.zig) take the engine's module instead of building a second copy, because a file can belong to only one module per compilation.

CI: test-metal-residency-owners-host is back in the Linux host shards. Its stale exclusion in zig/build/host_tests.zig is removed, and it is added to the linux_host list in zig/build/host_ci.zig.

Only build wiring, CI lists and test code change. No engine code changes, and no output tokens change.

  • Synthena

…heckpoint_metal reads

checkpoint_metal.zig reads safetensors and checkpoint_file_cache through core (since ec277c1), and in
test-metal-residency-owners-host core is residency_owner_tests.zig, which exported neither, so the step
stopped compiling. The root now exports both, as zig/qwen27_core.zig does.
The native-inventory test builds its auxiliary draft model as undefined and sets the backend's fields one
by one, but never attention_full. Its null default does not apply to undefined memory, so the optional read
as present and appendDraft listed a garbage buffer (id 0xaaaaaaaaaaaaaaaa); Resident.hold then faulted
reading its length (residency_recording_metal.zig:117, from resident.zig:165). The fixture now sets
attention_full = null, as a draft without a v1 full layer has. The residency owner code was right.
@ashhart
ashhart force-pushed the lead/residency-owners-test branch from 374bda8 to 6dc55e5 Compare November 25, 2026 03:38
… shared engine

Two real wiring gaps on a macOS host, found by type-checking the steps for aarch64-macos:
- test-qwen27's first test binary is the qwen27 module itself, which since 6efef02 holds mtp_pick.zig and
  its @import("bf16_topk"), but the module never got that import (qwen_core and the engine did). It now does
  (zig/build/qwen27.zig:108), the same s.bf16_topk module.
- native/metal.zig reaches native/inkling2.zig through tensorfold, and that file imports engine_api; the
  engine metalEngineModules builds has none until the native server adds one. compile-metal-residency-host
  and test-slide-metal-host compiled native/metal.zig against that engine and failed. build.zig now gives the
  shared macOS host engine one engine_api, and the residency, slide and Flash Next budget hosts take the
  engine's module instead of a second copy of the file.
The Linux host shards excluded it as red on main (#2031); it passes since the two commits before the
changelog line. The exclusion goes and the step joins linux_host, which shard A runs on every push (the step's
own name also hashes to shard A, so it runs once). compile-metal-residency-host is already in macos_adapters.
… Inkling 2 and H3 image modules

compile-fsr-metal-contract-host (zig/build/fsr.zig) and compile-gemma4-contract-host (zig/build/gemma4_host.zig)
each compile zig/tests/contract/metal_main.zig, which since the Inkling 2 Mini and H3 image contracts also
imports inkling2_metal, inkling2_glue_plan, inkling2_loop_plan, inkling2_runtime_plan and the three H3 image
kernel modules. Only tf-kernel-contract (kernel_contract.zig) passed them, so both compile-only roots failed
on a macOS host with "no module named 'inkling2_metal'". kernel_contract.metalRootImports now gives a root
that set, sharing the engine's own inkling2 modules (a file belongs to one module), and both roots use it.

This branch has not been deployed

No deployments
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