From 553d889ae45b22c4487d7d44f85235fed1f31eea Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Tue, 11 Aug 2026 08:29:47 +0700 Subject: [PATCH 1/2] Take vsa from the repository it was migrated to src/vsa.zig moved to gHashTag/zig-hdc in 42490a22 and the two references here were left pointing at the empty space -- one of the reasons this build has failed since March. The module is intact there and exports all fourteen symbols this repository asked of the file it lost. It could not simply be repointed at the time, because that package could not be depended on by anything: its manifest opened with { instead of .{, named itself with a bare identifier where an enum literal is required, carried no fingerprint, and gave its own dependency a url with no hash -- and its build script passed root_source_file to addTest, which stopped being a field in 0.15. Repaired in zig-hdc#1, which now has CI on the version this repository targets. The change here is two lines, not eleven, and the reason is worth recording: none of the eleven files in src/ that import vsa.zig is reachable from any of the 133 build roots under src/. Their broken imports have never mattered. Only build.zig itself named the file -- a test target and a module for TRI -- so only those two needed repointing. Measured before editing rather than assumed; the alternative plan was to rewrite eleven consumers that nothing compiles. The baseline drops from five to four, and the ratchet demanded it: a path that has been repaired and left in the file fails the check, which is what happened on the first run after this edit. --- build.zig | 30 +++++++++++++++++------------- build.zig.zon | 4 ++++ tools/build_paths_baseline.txt | 10 ++++------ 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/build.zig b/build.zig index 8bcbc94747..142d5ff364 100644 --- a/build.zig +++ b/build.zig @@ -182,14 +182,21 @@ pub fn build(b: *std.Build) void { const test_step = b.step("test", "Run library tests"); test_step.dependOn(&run_main_tests.step); - // VSA tests - const vsa_tests = b.addTest(.{ - .root_module = b.createModule(.{ - .root_source_file = b.path("src/vsa.zig"), - .target = target, - .optimize = optimize, - }), + // src/vsa.zig was migrated to gHashTag/zig-hdc in 42490a22 and the two + // references below were left pointing at the empty space, which is one of + // the reasons this build has failed since March. The module is intact + // there and exports all fourteen symbols this repository asked of the + // file it lost; the package itself could not be depended on until its + // manifest was repaired (zig-hdc#1), which is why the reference could not + // simply be updated at the time. + const zig_hdc_dep = b.dependency("zig_hdc", .{ + .target = target, + .optimize = optimize, }); + const hdc_vsa = zig_hdc_dep.module("zig-hdc-vsa"); + + // VSA tests + const vsa_tests = b.addTest(.{ .root_module = hdc_vsa }); const run_vsa_tests = b.addRunArtifact(vsa_tests); test_step.dependOn(&run_vsa_tests.step); @@ -1145,12 +1152,9 @@ pub fn build(b: *std.Build) void { .optimize = optimize, }); - // VSA module for TRI (moved up: needed by tvc_corpus_mod and fluent CLI) - const vsa_tri = b.createModule(.{ - .root_source_file = b.path("src/vsa.zig"), - .target = target, - .optimize = optimize, - }); + // VSA module for TRI (needed by tvc_corpus_mod and fluent CLI), now the + // migrated module rather than a path to a file that is not here. + const vsa_tri = hdc_vsa; // TVC Corpus module for TRI (moved up: needed by fluent CLI and hybrid chat) const tvc_corpus_mod = b.createModule(.{ .root_source_file = b.path("src/tvc/tvc_corpus.zig"), diff --git a/build.zig.zon b/build.zig.zon index 11fda9ad8c..67afc6b2e8 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -10,6 +10,10 @@ .url = "git+https://github.com/raylib-zig/raylib-zig#cd71c85d571027ac8033357f83b124ee051825b3", .hash = "raylib_zig-5.6.0-dev-KE8REENOBQC-m5nK7M2b5aKSIubJPbPLUYcRhT7aT3RN", }, + .zig_hdc = .{ + .url = "https://github.com/gHashTag/zig-hdc/archive/main.tar.gz", + .hash = "zig_hdc-0.1.0-6NS2Eoy7FgAFWrBY3anapf1nXxhm6TvPApY3NHoSW8MG", + }, }, .paths = .{""}, .fingerprint = 0xa9f69745ba7ed82d, diff --git a/tools/build_paths_baseline.txt b/tools/build_paths_baseline.txt index 6b970a3248..5d4704e2cf 100644 --- a/tools/build_paths_baseline.txt +++ b/tools/build_paths_baseline.txt @@ -6,11 +6,10 @@ # relocations and are fixed. These five are not, and each needs a decision # rather than a guess: # -# src/vsa.zig -# Migrated to gHashTag/zig-hdc, which still has it and exports all fourteen -# symbols the eleven consumers in src/ need. Blocked on that repository's -# build.zig.zon, which predates the .fingerprint and dependency-.hash -# requirements and so cannot be depended on by zig 0.15.2 as it stands. +# src/vsa.zig was here and is gone from the list: zig-hdc#1 repaired that +# package's manifest so it can be depended on, and build.zig now takes the +# module from the dependency instead of a path to a file this repository no +# longer contains. # # src/cli/entrypoint_train.zig # src/hslm/bpe_train.zig @@ -31,5 +30,4 @@ src/cli/entrypoint_train.zig src/hslm/bpe_train.zig src/hslm/hslm_benchmark.zig -src/vsa.zig trinity-nexus/output/lang/zig/full-serve-v1.zig From 02e8e057ab13aad3122c68e2bcfdee496a52828f Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Tue, 11 Aug 2026 08:31:41 +0700 Subject: [PATCH 2/2] The vsa tests run where the code lives addTest requires its root module to carry a known target, and a module exported by a dependency does not -- it takes its target from whatever compiles it, so passing it straight to addTest panics in the build runner. Rebuilding one locally from the dependency's source would mean re-declaring that package's own imports here and testing somebody else's code from the outside. gHashTag/zig-hdc runs zig build test over exactly this module in its own CI, on 0.15.2, the version this repository targets -- so the tests execute where the code lives and against the compiler that will consume it. --- build.zig | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/build.zig b/build.zig index 142d5ff364..789dbde125 100644 --- a/build.zig +++ b/build.zig @@ -195,10 +195,16 @@ pub fn build(b: *std.Build) void { }); const hdc_vsa = zig_hdc_dep.module("zig-hdc-vsa"); - // VSA tests - const vsa_tests = b.addTest(.{ .root_module = hdc_vsa }); - const run_vsa_tests = b.addRunArtifact(vsa_tests); - test_step.dependOn(&run_vsa_tests.step); + // VSA tests are no longer run from here. addTest requires its root module to + // carry a known target, and a module exported by a dependency does not: it + // takes its target from whatever compiles it. Rebuilding one locally from + // the dependency's source would mean re-declaring that package's own + // imports here and testing somebody else's code from the outside. + // + // They are not lost, which is the part that matters. gHashTag/zig-hdc runs + // `zig build test` over exactly this module in its own CI, on 0.15.2 -- + // the version this repository targets -- so the tests execute where the + // code lives and against the compiler that will consume it. // Queen API tests const queen_api_tests = b.addTest(.{