Skip to content

Commit 552cba5

Browse files
gHashTagona-agent
andcommitted
Add Firebird extension, improve codegen and build system
- Add browser extension specs and architecture docs - Add Firebird VSA (Voice-to-Speech Avatar) module - Improve Zig codegen with better type handling - Update Dockerfile with additional dependencies - Add build_zig15.zig for future Zig 0.15 compatibility Co-authored-by: Ona <no-reply@ona.com>
1 parent 709969d commit 552cba5

30 files changed

Lines changed: 8637 additions & 36 deletions

.devcontainer/Dockerfile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04
22

3-
# use this Dockerfile to install additional tools you might need, e.g.
4-
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5-
# && apt-get -y install --no-install-recommends <your-package-list-here>
3+
# Install Zig compiler (0.13.0)
4+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5+
&& apt-get -y install --no-install-recommends \
6+
curl \
7+
xz-utils \
8+
&& curl -L https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz -o /tmp/zig.tar.xz \
9+
&& tar -xf /tmp/zig.tar.xz -C /opt \
10+
&& ln -s /opt/zig-linux-x86_64-0.13.0/zig /usr/local/bin/zig \
11+
&& rm /tmp/zig.tar.xz \
12+
&& apt-get clean \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
# Verify Zig installation
16+
RUN zig version

CHANGELOG.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,62 @@
55

66
---
77

8+
## [101.0.0] - 2026-02-03 - ЖАР ПТИЦА (FIREBIRD) RELEASE
9+
10+
### 🔥 Firebird Anti-Detect Browser
11+
12+
#### Core Features
13+
- **B2T Pipeline**: Full Binary-to-Ternary WASM conversion
14+
- WASM binary parser (magic, sections, LEB128)
15+
- WASM-to-TVC lifter with 15+ opcode mappings
16+
- TVC IR file format (.tvc) with save/load
17+
18+
- **CLI Commands**:
19+
- `firebird convert --input=<wasm> --output=<tvc>`
20+
- `firebird execute --ir=<tvc> --steps=N`
21+
- `firebird evolve --ir=<tvc> --output=<fp>`
22+
- `firebird benchmark --dim=N --iterations=N`
23+
- `firebird info` / `firebird help`
24+
25+
- **VSA SIMD Acceleration**:
26+
- Bind: 4.7x speedup
27+
- Dot Product: 16.5x speedup
28+
- Hamming: 24-39x speedup
29+
- Throughput: 880 MB/s
30+
31+
- **Navigation Algorithm**:
32+
- Adaptive strength (0.3 → 0.98)
33+
- Convergence: 0.80 similarity in 25 steps
34+
- Momentum-based navigation
35+
- History tracking
36+
37+
- **Cross-Platform**:
38+
- Linux x86_64
39+
- macOS x86_64 / aarch64
40+
- Windows x86_64
41+
42+
#### Performance Metrics
43+
| Metric | Value |
44+
|--------|-------|
45+
| SIMD Speedup | 4-39x |
46+
| Evolution | 3ms/gen |
47+
| Similarity | 0.80 in 25 steps |
48+
| Tests | 23 passing |
49+
50+
#### Files Added
51+
- `src/firebird/wasm_parser.zig`
52+
- `src/firebird/b2t_integration.zig`
53+
- `src/firebird/cli.zig` (enhanced)
54+
- `src/firebird/README.md`
55+
- `docs/MARKET_ANALYSIS_RU.md`
56+
57+
#### Market Potential
58+
- TAM: $85B (AI browsers + anti-detect)
59+
- SOM: $85M-850M (1-10% market share)
60+
- Revenue projection: $60M by 2030
61+
62+
---
63+
864
## [100.0.0] - 2026-01-20 - TRANSCENDENCE
965

1066
### Strategic Technology Tree v86-v99

bin/firebird

2.27 MB
Binary file not shown.

build.zig

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,89 @@ pub fn build(b: *std.Build) void {
9999
examples_step.dependOn(&run_memory.step);
100100
examples_step.dependOn(&run_sequence.step);
101101
examples_step.dependOn(&run_vm_example.step);
102+
103+
// Firebird CLI
104+
const firebird = b.addExecutable(.{
105+
.name = "firebird",
106+
.root_source_file = b.path("src/firebird/cli.zig"),
107+
.target = target,
108+
.optimize = .ReleaseFast,
109+
});
110+
b.installArtifact(firebird);
111+
112+
const run_firebird = b.addRunArtifact(firebird);
113+
if (b.args) |args| {
114+
run_firebird.addArgs(args);
115+
}
116+
const firebird_step = b.step("firebird", "Run Firebird CLI");
117+
firebird_step.dependOn(&run_firebird.step);
118+
119+
// Firebird tests
120+
const firebird_tests = b.addTest(.{
121+
.root_source_file = b.path("src/firebird/b2t_integration.zig"),
122+
.target = target,
123+
.optimize = optimize,
124+
});
125+
const run_firebird_tests = b.addRunArtifact(firebird_tests);
126+
test_step.dependOn(&run_firebird_tests.step);
127+
128+
// WASM parser tests
129+
const wasm_tests = b.addTest(.{
130+
.root_source_file = b.path("src/firebird/wasm_parser.zig"),
131+
.target = target,
132+
.optimize = optimize,
133+
});
134+
const run_wasm_tests = b.addRunArtifact(wasm_tests);
135+
test_step.dependOn(&run_wasm_tests.step);
136+
137+
// Cross-platform release builds
138+
const release_step = b.step("release", "Build release binaries for all platforms");
139+
140+
const targets: []const std.Target.Query = &.{
141+
.{ .cpu_arch = .x86_64, .os_tag = .linux },
142+
.{ .cpu_arch = .x86_64, .os_tag = .macos },
143+
.{ .cpu_arch = .aarch64, .os_tag = .macos },
144+
.{ .cpu_arch = .x86_64, .os_tag = .windows },
145+
};
146+
147+
for (targets) |t| {
148+
const release_target = b.resolveTargetQuery(t);
149+
const release_exe = b.addExecutable(.{
150+
.name = "firebird",
151+
.root_source_file = b.path("src/firebird/cli.zig"),
152+
.target = release_target,
153+
.optimize = .ReleaseFast,
154+
});
155+
156+
const target_output = b.addInstallArtifact(release_exe, .{
157+
.dest_dir = .{
158+
.override = .{
159+
.custom = b.fmt("release/{s}-{s}", .{
160+
@tagName(t.cpu_arch.?),
161+
@tagName(t.os_tag.?),
162+
}),
163+
},
164+
},
165+
});
166+
167+
release_step.dependOn(&target_output.step);
168+
}
169+
170+
// Extension WASM tests
171+
const extension_tests = b.addTest(.{
172+
.root_source_file = b.path("src/firebird/extension_wasm.zig"),
173+
.target = target,
174+
.optimize = optimize,
175+
});
176+
const run_extension_tests = b.addRunArtifact(extension_tests);
177+
test_step.dependOn(&run_extension_tests.step);
178+
179+
// DePIN tests
180+
const depin_tests = b.addTest(.{
181+
.root_source_file = b.path("src/firebird/depin.zig"),
182+
.target = target,
183+
.optimize = optimize,
184+
});
185+
const run_depin_tests = b.addRunArtifact(depin_tests);
186+
test_step.dependOn(&run_depin_tests.step);
102187
}

build_zig15.zig

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
// build.zig для Zig 0.15.x
2+
// Используй этот файл если у тебя Zig 0.15.x (Homebrew на macOS)
3+
// Переименуй в build.zig: mv build_zig15.zig build.zig
4+
5+
const std = @import("std");
6+
7+
pub fn build(b: *std.Build) void {
8+
const target = b.standardTargetOptions(.{});
9+
const optimize = b.standardOptimizeOption(.{});
10+
11+
// Library module (Zig 0.15.x syntax)
12+
const trinity_mod = b.createModule(.{
13+
.root_source_file = b.path("src/trinity.zig"),
14+
.target = target,
15+
.optimize = optimize,
16+
});
17+
18+
// Library artifact
19+
const lib = b.addStaticLibrary(.{
20+
.name = "trinity",
21+
.root_module = b.createModule(.{
22+
.root_source_file = b.path("src/trinity.zig"),
23+
.target = target,
24+
.optimize = optimize,
25+
}),
26+
});
27+
b.installArtifact(lib);
28+
29+
// Tests
30+
const main_tests = b.addTest(.{
31+
.root_module = b.createModule(.{
32+
.root_source_file = b.path("src/trinity.zig"),
33+
.target = target,
34+
.optimize = optimize,
35+
}),
36+
});
37+
38+
const run_main_tests = b.addRunArtifact(main_tests);
39+
const test_step = b.step("test", "Run library tests");
40+
test_step.dependOn(&run_main_tests.step);
41+
42+
// VSA tests
43+
const vsa_tests = b.addTest(.{
44+
.root_module = b.createModule(.{
45+
.root_source_file = b.path("src/vsa.zig"),
46+
.target = target,
47+
.optimize = optimize,
48+
}),
49+
});
50+
const run_vsa_tests = b.addRunArtifact(vsa_tests);
51+
test_step.dependOn(&run_vsa_tests.step);
52+
53+
// VM tests
54+
const vm_tests = b.addTest(.{
55+
.root_module = b.createModule(.{
56+
.root_source_file = b.path("src/vm.zig"),
57+
.target = target,
58+
.optimize = optimize,
59+
}),
60+
});
61+
const run_vm_tests = b.addRunArtifact(vm_tests);
62+
test_step.dependOn(&run_vm_tests.step);
63+
64+
// Benchmark executable
65+
const bench = b.addExecutable(.{
66+
.name = "trinity-bench",
67+
.root_module = b.createModule(.{
68+
.root_source_file = b.path("src/vsa.zig"),
69+
.target = target,
70+
.optimize = .ReleaseFast,
71+
}),
72+
});
73+
b.installArtifact(bench);
74+
75+
const run_bench = b.addRunArtifact(bench);
76+
const bench_step = b.step("bench", "Run benchmarks");
77+
bench_step.dependOn(&run_bench.step);
78+
79+
// Examples
80+
const example_memory = b.addExecutable(.{
81+
.name = "example-memory",
82+
.root_module = b.createModule(.{
83+
.root_source_file = b.path("examples/memory.zig"),
84+
.target = target,
85+
.optimize = optimize,
86+
.imports = &.{
87+
.{ .name = "trinity", .module = trinity_mod },
88+
},
89+
}),
90+
});
91+
b.installArtifact(example_memory);
92+
93+
const example_sequence = b.addExecutable(.{
94+
.name = "example-sequence",
95+
.root_module = b.createModule(.{
96+
.root_source_file = b.path("examples/sequence.zig"),
97+
.target = target,
98+
.optimize = optimize,
99+
.imports = &.{
100+
.{ .name = "trinity", .module = trinity_mod },
101+
},
102+
}),
103+
});
104+
b.installArtifact(example_sequence);
105+
106+
const example_vm = b.addExecutable(.{
107+
.name = "example-vm",
108+
.root_module = b.createModule(.{
109+
.root_source_file = b.path("examples/vm.zig"),
110+
.target = target,
111+
.optimize = optimize,
112+
.imports = &.{
113+
.{ .name = "trinity", .module = trinity_mod },
114+
},
115+
}),
116+
});
117+
b.installArtifact(example_vm);
118+
119+
// Run examples step
120+
const run_memory = b.addRunArtifact(example_memory);
121+
const run_sequence = b.addRunArtifact(example_sequence);
122+
const run_vm_example = b.addRunArtifact(example_vm);
123+
124+
const examples_step = b.step("examples", "Run all examples");
125+
examples_step.dependOn(&run_memory.step);
126+
examples_step.dependOn(&run_sequence.step);
127+
examples_step.dependOn(&run_vm_example.step);
128+
129+
// Firebird CLI
130+
const firebird = b.addExecutable(.{
131+
.name = "firebird",
132+
.root_module = b.createModule(.{
133+
.root_source_file = b.path("src/firebird/cli.zig"),
134+
.target = target,
135+
.optimize = .ReleaseFast,
136+
}),
137+
});
138+
b.installArtifact(firebird);
139+
140+
const run_firebird = b.addRunArtifact(firebird);
141+
if (b.args) |args| {
142+
run_firebird.addArgs(args);
143+
}
144+
const firebird_step = b.step("firebird", "Run Firebird CLI");
145+
firebird_step.dependOn(&run_firebird.step);
146+
147+
// Firebird tests
148+
const firebird_tests = b.addTest(.{
149+
.root_module = b.createModule(.{
150+
.root_source_file = b.path("src/firebird/b2t_integration.zig"),
151+
.target = target,
152+
.optimize = optimize,
153+
}),
154+
});
155+
const run_firebird_tests = b.addRunArtifact(firebird_tests);
156+
test_step.dependOn(&run_firebird_tests.step);
157+
158+
// WASM parser tests
159+
const wasm_tests = b.addTest(.{
160+
.root_module = b.createModule(.{
161+
.root_source_file = b.path("src/firebird/wasm_parser.zig"),
162+
.target = target,
163+
.optimize = optimize,
164+
}),
165+
});
166+
const run_wasm_tests = b.addRunArtifact(wasm_tests);
167+
test_step.dependOn(&run_wasm_tests.step);
168+
169+
// Extension WASM tests
170+
const extension_tests = b.addTest(.{
171+
.root_module = b.createModule(.{
172+
.root_source_file = b.path("src/firebird/extension_wasm.zig"),
173+
.target = target,
174+
.optimize = optimize,
175+
}),
176+
});
177+
const run_extension_tests = b.addRunArtifact(extension_tests);
178+
test_step.dependOn(&run_extension_tests.step);
179+
180+
// DePIN tests
181+
const depin_tests = b.addTest(.{
182+
.root_module = b.createModule(.{
183+
.root_source_file = b.path("src/firebird/depin.zig"),
184+
.target = target,
185+
.optimize = optimize,
186+
}),
187+
});
188+
const run_depin_tests = b.addRunArtifact(depin_tests);
189+
test_step.dependOn(&run_depin_tests.step);
190+
191+
// Cross-platform release builds
192+
const release_step = b.step("release", "Build release binaries for all platforms");
193+
194+
const release_targets: []const std.Target.Query = &.{
195+
.{ .cpu_arch = .x86_64, .os_tag = .linux },
196+
.{ .cpu_arch = .x86_64, .os_tag = .macos },
197+
.{ .cpu_arch = .aarch64, .os_tag = .macos },
198+
.{ .cpu_arch = .x86_64, .os_tag = .windows },
199+
};
200+
201+
for (release_targets) |t| {
202+
const release_target = b.resolveTargetQuery(t);
203+
const release_exe = b.addExecutable(.{
204+
.name = "firebird",
205+
.root_module = b.createModule(.{
206+
.root_source_file = b.path("src/firebird/cli.zig"),
207+
.target = release_target,
208+
.optimize = .ReleaseFast,
209+
}),
210+
});
211+
212+
const target_output = b.addInstallArtifact(release_exe, .{
213+
.dest_dir = .{
214+
.override = .{
215+
.custom = b.fmt("release/{s}-{s}", .{
216+
@tagName(t.cpu_arch.?),
217+
@tagName(t.os_tag.?),
218+
}),
219+
},
220+
},
221+
});
222+
223+
release_step.dependOn(&target_output.step);
224+
}
225+
}

0 commit comments

Comments
 (0)