Skip to content

Commit 36815c4

Browse files
author
Antigravity Agent
committed
chore: Merge remote changes (#435)
2 parents 9495412 + cd477a3 commit 36815c4

33 files changed

+979
-431
lines changed

.github/workflows/brain-ci.yml

Lines changed: 42 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ on:
1111
- cron: '0 0 * * 0'
1212

1313
env:
14-
ZIG_VERSION: "0.15.2"
1514
BRAIN_HEALTH_THRESHOLD: "80" # Minimum health score for merge
1615
STRESS_TEST_THRESHOLD: "270" # Minimum stress test score (270/300 = 90%)
1716

@@ -24,13 +23,10 @@ jobs:
2423
runs-on: ubuntu-latest
2524
timeout-minutes: 5
2625
steps:
27-
- name: Install Zig
28-
run: |
29-
wget -q https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz
30-
tar -xf zig-linux-x86_64-${ZIG_VERSION}.tar.xz
31-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zig /usr/local/bin/
32-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zigmCache /usr/local/bin/
33-
zig version
26+
- name: Setup Zig
27+
uses: mlugg/setup-zig@v2
28+
with:
29+
version: 0.15.2
3430

3531
- name: Checkout Trinity
3632
uses: actions/checkout@v4
@@ -39,7 +35,7 @@ jobs:
3935

4036
- name: Build TRI Binary
4137
run: |
42-
zig build tri
38+
zig build tri -Dci=true
4339
4440
- name: Run Brain Health Check
4541
id: health
@@ -125,22 +121,19 @@ jobs:
125121
runs-on: ubuntu-latest
126122
timeout-minutes: 5
127123
steps:
128-
- name: Install Zig
129-
run: |
130-
wget -q https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz
131-
tar -xf zig-linux-x86_64-${ZIG_VERSION}.tar.xz
132-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zig /usr/local/bin/
133-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zigmCache /usr/local/bin/
134-
zig version
124+
- name: Setup Zig
125+
uses: mlugg/setup-zig@v2
126+
with:
127+
version: 0.15.2
135128

136129
- name: Checkout Trinity
137130
uses: actions/checkout@v4
138131
with:
139132
submodules: recursive
140133

141-
- name: Build All Binaries
134+
- name: Build TRI Binary
142135
run: |
143-
zig build
136+
zig build tri -Dci=true
144137
145138
# =========================================================================
146139
# Phase 2: Unit Tests — Individual Brain Regions
@@ -160,13 +153,10 @@ jobs:
160153
- intraparietal
161154
- hslm
162155
steps:
163-
- name: Install Zig
164-
run: |
165-
wget -q https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz
166-
tar -xf zig-linux-x86_64-${ZIG_VERSION}.tar.xz
167-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zig /usr/local/bin/
168-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zigmCache /usr/local/bin/
169-
zig version
156+
- name: Setup Zig
157+
uses: mlugg/setup-zig@v2
158+
with:
159+
version: 0.15.2
170160

171161
- name: Checkout Trinity
172162
uses: actions/checkout@v4
@@ -175,7 +165,7 @@ jobs:
175165

176166
- name: Test ${{ matrix.region }}
177167
run: |
178-
zig build test-${{ matrix.region }}
168+
zig build test-${{ matrix.region }} -Dci=true
179169
180170
# =========================================================================
181171
# Phase 3: Integration Test — Brain Aggregator
@@ -186,13 +176,10 @@ jobs:
186176
needs: brain-unit
187177
timeout-minutes: 10
188178
steps:
189-
- name: Install Zig
190-
run: |
191-
wget -q https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz
192-
tar -xf zig-linux-x86_64-${ZIG_VERSION}.tar.xz
193-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zig /usr/local/bin/
194-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zigmCache /usr/local/bin/
195-
zig version
179+
- name: Setup Zig
180+
uses: mlugg/setup-zig@v2
181+
with:
182+
version: 0.15.2
196183

197184
- name: Checkout Trinity
198185
uses: actions/checkout@v4
@@ -201,7 +188,7 @@ jobs:
201188

202189
- name: Test Brain Integration
203190
run: |
204-
zig build test-brain
191+
zig build test-brain -Dci=true
205192
206193
# =========================================================================
207194
# Phase 4: Stress Test — "Functional MRI" Gate
@@ -212,13 +199,10 @@ jobs:
212199
needs: brain-integration
213200
timeout-minutes: 15
214201
steps:
215-
- name: Install Zig
216-
run: |
217-
wget -q https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz
218-
tar -xf zig-linux-x86_64-${ZIG_VERSION}.tar.xz
219-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zig /usr/local/bin/
220-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zigmCache /usr/local/bin/
221-
zig version
202+
- name: Setup Zig
203+
uses: mlugg/setup-zig@v2
204+
with:
205+
version: 0.15.2
222206

223207
- name: Checkout Trinity
224208
uses: actions/checkout@v4
@@ -229,7 +213,7 @@ jobs:
229213
id: stress
230214
run: |
231215
# Run stress test and capture output
232-
zig build test-brain-stress 2>&1 | tee /tmp/stress-output.txt
216+
zig build test-brain-stress -Dci=true 2>&1 | tee /tmp/stress-output.txt
233217
234218
# Extract score from output
235219
STRESS_SCORE=$(grep "Score:" /tmp/stress-output.txt | tail -1 | grep -oE "[0-9]+" || echo "0")
@@ -331,13 +315,10 @@ jobs:
331315
needs: brain-stress
332316
timeout-minutes: 5
333317
steps:
334-
- name: Install Zig
335-
run: |
336-
wget -q https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz
337-
tar -xf zig-linux-x86_64-${ZIG_VERSION}.tar.xz
338-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zig /usr/local/bin/
339-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zigmCache /usr/local/bin/
340-
zig version
318+
- name: Setup Zig
319+
uses: mlugg/setup-zig@v2
320+
with:
321+
version: 0.15.2
341322

342323
- name: Checkout Trinity
343324
uses: actions/checkout@v4
@@ -346,7 +327,7 @@ jobs:
346327

347328
- name: Build TRI Binary
348329
run: |
349-
zig build tri
330+
zig build tri -Dci=true
350331
351332
- name: CLI Commands Test
352333
run: |
@@ -373,13 +354,10 @@ jobs:
373354
if: always()
374355
timeout-minutes: 5
375356
steps:
376-
- name: Install Zig
377-
run: |
378-
wget -q https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz
379-
tar -xf zig-linux-x86_64-${ZIG_VERSION}.tar.xz
380-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zig /usr/local/bin/
381-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zigmCache /usr/local/bin/
382-
zig version
357+
- name: Setup Zig
358+
uses: mlugg/setup-zig@v2
359+
with:
360+
version: 0.15.2
383361

384362
- name: Checkout Trinity
385363
uses: actions/checkout@v4
@@ -388,7 +366,7 @@ jobs:
388366

389367
- name: Build TRI Binary
390368
run: |
391-
zig build tri
369+
zig build tri -Dci=true
392370
393371
- name: Export Metrics
394372
run: |
@@ -471,13 +449,10 @@ jobs:
471449
if: github.event_name == 'schedule'
472450
timeout-minutes: 10
473451
steps:
474-
- name: Install Zig
475-
run: |
476-
wget -q https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz
477-
tar -xf zig-linux-x86_64-${ZIG_VERSION}.tar.xz
478-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zig /usr/local/bin/
479-
sudo mv zig-linux-x86_64-${ZIG_VERSION}/zigmCache /usr/local/bin/
480-
zig version
452+
- name: Setup Zig
453+
uses: mlugg/setup-zig@v2
454+
with:
455+
version: 0.15.2
481456

482457
- name: Checkout Trinity
483458
uses: actions/checkout@v4
@@ -486,11 +461,11 @@ jobs:
486461

487462
- name: Build TRI Binary
488463
run: |
489-
zig build tri
464+
zig build tri -Dci=true
490465
491466
- name: Run Full Stress Test
492467
run: |
493-
zig build test-brain-stress 2>&1 | tee /tmp/weekly-stress.txt
468+
zig build test-brain-stress -Dci=true 2>&1 | tee /tmp/weekly-stress.txt
494469
495470
- name: Record Weekly Snapshot
496471
run: |

.github/workflows/ci-runner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run: zig build -Dci=true --summary all
2626

2727
- name: Test
28-
run: zig build test --summary all
28+
run: zig build test -Dci=true --summary all
2929

3030
- name: Telegram notify
3131
if: failure()

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
run: |
3636
# Run tests with Zig's built-in leak detection
3737
# Tests using std.testing.allocator will automatically detect leaks
38-
zig build test 2>&1 | tee test-output.txt
38+
zig build test -Dci=true 2>&1 | tee test-output.txt
3939
# Check for any memory leak indicators
4040
if grep -i "leak\|memory.*leak\|allocation.*leak" test-output.txt; then
4141
echo "::error::Memory leaks detected in tests"

.github/workflows/fpga-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ jobs:
141141

142142
- name: Build and run tests
143143
run: |
144-
zig build test 2>&1 | tee test-output.txt
144+
zig build test -Dci=true 2>&1 | tee test-output.txt
145145
146146
- name: Check test results
147147
run: |

.github/workflows/fpga-regression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989

9090
- name: "🏗️ Build Trinity"
9191
run: |
92-
zig build 2>&1 || echo "⚠️ Build warnings present"
92+
zig build -Dci=true 2>&1 || echo "⚠️ Build warnings present"
9393
echo "✅ Trinity build complete"
9494
9595
- name: "🧠 Run FPGA Tests (${{ matrix.consciousness }})"

.github/workflows/pre-commit-check.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,30 @@ jobs:
88
name: Code Format Validation
99
runs-on: ubuntu-latest
1010
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Zig
15+
uses: mlugg/setup-zig@v2
16+
with:
17+
version: 0.15.2
18+
1119
- name: Check zig fmt
1220
run: |
13-
git diff --name-only --cached --diff-filter=M '*.zig' | grep '^A.*zig$' | xargs zig fmt --check
14-
if [ $? -ne 0 ]; then
15-
echo "❌ Code not formatted. Run: zig fmt src/"
16-
exit 1
21+
FILES=$(git diff --name-only origin/main...HEAD -- '*.zig' || true)
22+
if [ -n "$FILES" ]; then
23+
echo "$FILES" | xargs zig fmt --check
24+
if [ $? -ne 0 ]; then
25+
echo "Code not formatted. Run: zig fmt src/"
26+
exit 1
27+
fi
1728
fi
18-
echo "All zig code formatted"
29+
echo "All zig code formatted"
1930
2031
- name: Check whitespace
2132
run: |
22-
TRAILING=$(git diff --cached HEAD -- '*.zig' | grep -E '^\+.*$' | wc -l)
33+
TRAILING=$(git diff origin/main...HEAD -- '*.zig' | grep -E '^\+.*[[:space:]]$' | wc -l)
2334
if [ "$TRAILING" -gt 0 ]; then
24-
echo "Trailing whitespace detected"
35+
echo "Trailing whitespace detected"
2536
exit 1
2637
fi

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ fpga/openxc7-synth/forge_ref.bit
115115
fpga/openxc7-synth/*.json
116116
fpga/fly-vivado/output/
117117

118-
# Generated segbits data (7MB+, regenerate with: python3 tools/gen_segbits.py)
119-
src/forge/segbits_data.zig
118+
# Generated segbits data — stub is tracked, full data (7MB+) is generated by:
119+
# python3 tools/gen_segbits.py --part xc7a100t
120+
# Do NOT add the full generated file to git. The stub provides compile-time API.
120121

121122
# Microsoft model weights
122123
data/models/microsoft-bitnet-2b/

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "zig-half"]
2-
path = tools/bin/repo-root/zig-half
3-
url = /Users/playra/zig-half

build.zig

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ pub fn build(b: *std.Build) void {
208208
.root_source_file = b.path("src/queen_api.zig"),
209209
.target = target,
210210
.optimize = optimize,
211+
.link_libc = true,
211212
}),
212213
});
213214
const run_queen_api_tests = b.addRunArtifact(queen_api_tests);
@@ -249,46 +250,6 @@ pub fn build(b: *std.Build) void {
249250
const run_vm_tests = b.addRunArtifact(vm_tests);
250251
test_step.dependOn(&run_vm_tests.step);
251252

252-
// VM Core Consolidation Tests (Phase 1)
253-
const vm_core_tests = b.addTest(.{
254-
.root_module = b.createModule(.{
255-
.root_source_file = b.path("src/vm/core/vm_core.zig"),
256-
.target = target,
257-
.optimize = optimize,
258-
}),
259-
});
260-
const vm_memory_tests = b.addTest(.{
261-
.root_module = b.createModule(.{
262-
.root_source_file = b.path("src/vm/core/vm_memory.zig"),
263-
.target = target,
264-
.optimize = optimize,
265-
}),
266-
});
267-
const vm_dispatch_tests = b.addTest(.{
268-
.root_module = b.createModule(.{
269-
.root_source_file = b.path("src/vm/core/vm_dispatch.zig"),
270-
.target = target,
271-
.optimize = optimize,
272-
}),
273-
});
274-
const vm_test_utils_tests = b.addTest(.{
275-
.root_module = b.createModule(.{
276-
.root_source_file = b.path("src/vm/core/vm_test_utils.zig"),
277-
.target = target,
278-
.optimize = optimize,
279-
}),
280-
});
281-
282-
const run_vm_core_tests = b.addRunArtifact(vm_core_tests);
283-
const run_vm_memory_tests = b.addRunArtifact(vm_memory_tests);
284-
const run_vm_dispatch_tests = b.addRunArtifact(vm_dispatch_tests);
285-
const run_vm_test_utils_tests = b.addRunArtifact(vm_test_utils_tests);
286-
287-
test_step.dependOn(&run_vm_core_tests.step);
288-
test_step.dependOn(&run_vm_memory_tests.step);
289-
test_step.dependOn(&run_vm_dispatch_tests.step);
290-
test_step.dependOn(&run_vm_test_utils_tests.step);
291-
292253
// E2E + Benchmarks + Verdict tests (Phase 4)
293254
const e2e_tests = b.addTest(.{
294255
.root_module = b.createModule(.{
@@ -308,6 +269,7 @@ pub fn build(b: *std.Build) void {
308269
.root_source_file = b.path("src/c_api.zig"),
309270
.target = target,
310271
.optimize = optimize,
272+
.link_libc = true,
311273
}),
312274
});
313275
const run_c_api_tests = b.addRunArtifact(c_api_tests);
@@ -2599,6 +2561,7 @@ pub fn build(b: *std.Build) void {
25992561
.root_source_file = b.path("src/tri/main.zig"),
26002562
.target = target,
26012563
.optimize = optimize,
2564+
.link_libc = true,
26022565
.imports = &.{
26032566
.{ .name = "trinity_workspace", .module = trinity_workspace_mod },
26042567
.{ .name = "trinity_swe", .module = vibeec_swe },
@@ -3624,6 +3587,7 @@ pub fn build(b: *std.Build) void {
36243587
.root_source_file = b.path("src/tri/sacred_alu.zig"),
36253588
.target = target,
36263589
.optimize = .ReleaseFast,
3590+
.link_libc = true,
36273591
}),
36283592
});
36293593
b.installArtifact(sacred);

0 commit comments

Comments
 (0)