From 2d3f76a6dde91bc26973ab55a17a5d17418d560d Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Tue, 11 Aug 2026 11:36:56 +0700 Subject: [PATCH] The library facade takes its core modules from where they went src/trinity.zig imported bigint.zig, packed_trit.zig, hybrid.zig and vsa/core.zig -- four files that 42490a22 moved into gHashTag/zig-hdc and gHashTag/zig-golden-float without moving the references. It is the library root, so three separate targets root it and all three failed. The aliasing was decided by a symbol test rather than by names, and the names would have led the wrong way: golden-float exports `bigint`, and that name points at its ternary/hybrid.zig, while the actual big-integer module is exported as `ternary_primitives`. Checked against every re-export in this file, zig-hdc's vsa module carries all sixteen VSA names, golden-float carries TVCBigInt, PackedBigInt, HybridBigInt, Trit, MAX_TRITS and TRITS_PER_BYTE. vsa/agent.zig is not re-exported any more. Its five parts have never been tracked here and are not in zig-hdc either, where the same facade was withdrawn last night. Nothing in this file referenced vsa_agent, so this removes a name nobody could resolve rather than a capability anybody had. Reachable missing files drop from thirteen to ten. --- build.zig | 25 +++++++++++++++++++++++++ build.zig.zon | 4 ++++ src/trinity.zig | 28 ++++++++++++++++++++++------ 3 files changed, 51 insertions(+), 6 deletions(-) diff --git a/build.zig b/build.zig index 789dbde125..88ec6852fa 100644 --- a/build.zig +++ b/build.zig @@ -13,11 +13,28 @@ pub fn build(b: *std.Build) void { // Cycle 78: Optional tree-sitter integration for VIBEE AST analysis const enable_treesitter = b.option(bool, "treesitter", "Enable tree-sitter AST analysis for VIBEE (requires libtree-sitter)") orelse false; + // The modules src/trinity.zig lost when 42490a22 moved them out. Declared + // here, before the first use, because three separate targets root that file. + // + // The naming in golden-float is confusing enough to be worth writing down: + // its root exports `bigint`, and that name points at ternary/hybrid.zig, + // while the actual bigint is exported as `ternary_primitives`. The aliases + // below are chosen by what each module CONTAINS -- checked symbol by symbol + // against what src/trinity.zig re-exports -- not by what it is called. + const zig_hdc_dep2 = b.dependency("zig_hdc", .{ .target = target, .optimize = optimize }); + const gf_dep = b.dependency("zig_golden_float", .{ .target = target, .optimize = optimize }); + const hdc_vsa_mod = zig_hdc_dep2.module("zig-hdc-vsa"); + const gf_mod = gf_dep.module("golden-float"); + // Library module for imports const trinity_mod = b.createModule(.{ .root_source_file = b.path("src/trinity.zig"), .target = target, .optimize = optimize, + .imports = &.{ + .{ .name = "hdc_vsa", .module = hdc_vsa_mod }, + .{ .name = "golden_float", .module = gf_mod }, + }, }); // VIBEEC compiler module — single source of truth from trinity-nexus/lang @@ -44,6 +61,10 @@ pub fn build(b: *std.Build) void { .root_source_file = b.path("src/trinity.zig"), .target = target, .optimize = optimize, + .imports = &.{ + .{ .name = "hdc_vsa", .module = hdc_vsa_mod }, + .{ .name = "golden_float", .module = gf_mod }, + }, }), }); b.installArtifact(lib); @@ -175,6 +196,10 @@ pub fn build(b: *std.Build) void { .root_source_file = b.path("src/trinity.zig"), .target = target, .optimize = optimize, + .imports = &.{ + .{ .name = "hdc_vsa", .module = hdc_vsa_mod }, + .{ .name = "golden_float", .module = gf_mod }, + }, }), }); diff --git a/build.zig.zon b/build.zig.zon index 67afc6b2e8..65b1e958d7 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -14,6 +14,10 @@ .url = "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/gHashTag/zig-hdc/archive/main.tar.gz", .hash = "zig_hdc-0.1.0-6NS2Eoy7FgAFWrBY3anapf1nXxhm6TvPApY3NHoSW8MG", }, + .zig_golden_float = .{ + .url = "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/gHashTag/zig-golden-float/archive/main.tar.gz", + .hash = "golden_float-2.1.0-h7LKhQ3lCgBfkjryIT9MnOTWleMQrdrgOIxQOhxqzTVu", + }, }, .paths = .{""}, .fingerprint = 0xa9f69745ba7ed82d, diff --git a/src/trinity.zig b/src/trinity.zig index edf032d829..5978f68ed6 100644 --- a/src/trinity.zig +++ b/src/trinity.zig @@ -9,14 +9,30 @@ const std = @import("std"); -// Core modules -pub const bigint = @import("bigint.zig"); -pub const packed_trit = @import("packed_trit.zig"); -pub const hybrid = @import("hybrid.zig"); -pub const vsa = @import("vsa/core.zig"); -pub const vsa_agent = @import("vsa/agent.zig"); +// Core modules. +// +// Four of these were files in this repository until 42490a22 moved them into +// gHashTag/zig-hdc and gHashTag/zig-golden-float without moving the references, +// which is one of the reasons this build failed from March. They come from +// those packages now. +// +// The aliasing is decided by what each module CONTAINS, checked symbol by +// symbol against the re-exports below, not by what it is called: golden-float +// exports `bigint` and that name points at its ternary/hybrid.zig, while the +// actual big-integer module is exported as `ternary_primitives`. +const golden_float = @import("golden_float"); + +pub const bigint = golden_float.ternary_primitives; +pub const packed_trit = golden_float.packed_trit; +pub const hybrid = golden_float.bigint; +pub const vsa = @import("hdc_vsa"); pub const vm = @import("vm.zig"); +// vsa/agent.zig is not re-exported. Its five parts have never been tracked in +// this repository, and they are not in zig-hdc either -- the facade there was +// withdrawn for the same reason. Nothing below referenced vsa_agent, so this +// removes a name nobody could resolve rather than a capability anybody had. + // SDK modules (high-level API) pub const sdk = @import("sdk.zig"); pub const science = @import("science.zig");