Skip to content

Commit 21d2cef

Browse files
gHashTagona-agent
andcommitted
feat: Real VSA @import Integration — Cycle 50
Generated vsa_imported_system.zig with 126 tests calling real VSA operations (bind, unbind, bundle, permute, cosineSimilarity) via @import("vsa") on HybridBigInt vectors. Updated build_zig13.zig permanently: - vsa module definition for generated code imports - test-vsa-imported step in main test target - vibee compiler build step zig build test: 585/585 tests, 17/17 steps. 134 real vsa.* calls in generated code. Co-authored-by: Ona <no-reply@ona.com>
1 parent 572a9ac commit 21d2cef

3 files changed

Lines changed: 2375 additions & 0 deletions

File tree

build_zig13.zig

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,39 @@ pub fn build(b: *std.Build) void {
184184
});
185185
const run_depin_tests = b.addRunArtifact(depin_tests);
186186
test_step.dependOn(&run_depin_tests.step);
187+
188+
// VSA module for generated code imports
189+
const vsa_mod = b.addModule("vsa", .{
190+
.root_source_file = b.path("src/vsa.zig"),
191+
.target = target,
192+
.optimize = optimize,
193+
});
194+
195+
// Generated VSA Imported System tests (real @import)
196+
const vsa_imported_tests = b.addTest(.{
197+
.root_source_file = b.path("generated/vsa_imported_system.zig"),
198+
.target = target,
199+
.optimize = optimize,
200+
});
201+
vsa_imported_tests.root_module.addImport("vsa", vsa_mod);
202+
const run_vsa_imported = b.addRunArtifact(vsa_imported_tests);
203+
const vsa_imported_step = b.step("test-vsa-imported", "Test VSA Imported System (real @import)");
204+
vsa_imported_step.dependOn(&run_vsa_imported.step);
205+
test_step.dependOn(&run_vsa_imported.step);
206+
207+
// VIBEE Compiler CLI
208+
const vibee = b.addExecutable(.{
209+
.name = "vibee",
210+
.root_source_file = b.path("src/vibeec/gen_cmd.zig"),
211+
.target = target,
212+
.optimize = optimize,
213+
});
214+
b.installArtifact(vibee);
215+
216+
const run_vibee = b.addRunArtifact(vibee);
217+
if (b.args) |args| {
218+
run_vibee.addArgs(args);
219+
}
220+
const vibee_step = b.step("vibee", "Run VIBEE Compiler CLI");
221+
vibee_step.dependOn(&run_vibee.step);
187222
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Golden Chain Cycle 50: Codegen @import Support — Real VSA Integration
2+
3+
**Date:** 2026-02-07
4+
**Status:** Complete
5+
**Needle Score:** 0.210 (below 0.618 threshold)
6+
7+
## Summary
8+
9+
Generated `vsa_imported_system.zig` with real `@import("vsa")` integration. 126 tests call actual VSA operations (`bind`, `unbind`, `bundle2/3`, `permute`, `cosineSimilarity`, `hammingDistance`, `encodeText`, `charToVector`, etc.) on real `HybridBigInt` vectors.
10+
11+
Updated `build_zig13.zig` permanently with:
12+
- `vsa` module definition
13+
- `test-vsa-imported` step (added to main `test` step)
14+
- `vibee` compiler build step
15+
16+
## How It Works
17+
18+
1. **Spec** declares `imports: [{name: vsa, path: "../src/vsa.zig"}]`
19+
2. **Emitter** generates `const vsa = @import("vsa");` at file top
20+
3. **Emitter** recognizes `real*` prefixed behaviors and generates actual `vsa.*` calls
21+
4. **Build.zig** provides `vsa` module to the generated test via `addImport`
22+
5. **Tests** exercise real VSA operations on real `HybridBigInt` data
23+
24+
## Test Results
25+
26+
`zig build test` output:
27+
```
28+
Build Summary: 17/17 steps succeeded; 585/585 tests passed
29+
+- run test 157 passed (trinity.zig)
30+
+- run test 83 passed (vsa.zig)
31+
+- run test 133 passed (vm.zig)
32+
+- run test 23 passed (b2t_integration)
33+
+- run test 27 passed (wasm_parser)
34+
+- run test 31 passed (extension_wasm)
35+
+- run test 5 passed (depin)
36+
+- run test 126 passed (vsa_imported_system — REAL @import)
37+
```
38+
39+
VIBEE standalone modules: 358/358 tests (14 modules)
40+
41+
## Metrics
42+
43+
| Metric | Value |
44+
|--------|-------|
45+
| Real VSA calls in generated code | 134 |
46+
| Tests with real @import | 126 |
47+
| Build steps | 17/17 |
48+
| Core tests (zig build test) | 585/585 |
49+
| VIBEE standalone tests | 358/358 |
50+
| Combined unique | 727 |
51+
| TODOs | 0 |
52+
53+
## Files Modified
54+
55+
| File | Change |
56+
|------|--------|
57+
| `build_zig13.zig` | Added vsa module, test-vsa-imported step, vibee step (permanent) |
58+
| `generated/vsa_imported_system.zig` | Regenerated with real VSA calls |
59+
60+
## Needle Assessment
61+
62+
Improvement rate 0.210 is below 0.618. The test count delta (+126) is modest relative to the 601 baseline. However, this cycle's value is qualitative: generated code now calls real VSA functions for the first time, proving the @import pipeline works end-to-end.
63+
64+
---
65+
**Formula:** phi^2 + 1/phi^2 = 3

0 commit comments

Comments
 (0)