Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
uses: mlugg/setup-zig@v2
with:
version: 0.15.0

Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/test-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ jobs:
uses: actions/checkout@v4

- name: Install Zig
uses: goto-bus/setup-zig@v2
uses: mlugg/setup-zig@v2
with:
version: 0.15.2

- name: Build shared library
run: zig build shared
run: |
zig build shared
echo "GOLDENFLOAT_LIB_DIR=$PWD/zig-out/lib" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$PWD/zig-out/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" >> $GITHUB_ENV

- name: Test Zig
if: matrix.language == 'zig'
Expand Down Expand Up @@ -77,6 +80,7 @@ jobs:
if: matrix.language == 'cpp'
run: |
cd cpp
rm -rf build
mkdir -p build
cmake -S . -B build
cmake --build build --target test_gf16
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ zig/
rust/target/
rust/*.rs
rust/test_nan
cpp/build/
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ readme = "README.md"
reqwest = { version = "0.12", features = ["blocking"] }

[dependencies]
[target.'cfg(unix(all(not(target_os = "windows")))'.dependencies]
[target.'cfg(unix)'.dependencies]
libc = "0.2"

[[bin]]
Expand Down
54 changes: 51 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@ pub fn build(b: *std.Build) void {
.version = .{ .major = 1, .minor = 1, .patch = 0 },
});

b.installArtifact(c_abi_lib);
const c_abi_install = b.installArtifact(c_abi_lib);

// Install C header alongside library
const header_install = b.addInstallHeaderFile(b.path("src/c/gf16.h"), "gf16.h");

const shared_step = b.step("shared", "Build C-ABI shared library (libgoldenfloat)");
shared_step.dependOn(&c_abi_lib.step);
shared_step.dependOn(&c_abi_install.step);
shared_step.dependOn(&header_install.step);

// ─────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -111,8 +110,57 @@ pub fn build(b: *std.Build) void {

const run_tests = b.addRunArtifact(formats_tests);
const run_transcendent_tests = b.addRunArtifact(transcendent_tests);

// ─────────────────────────────────────────────────────────────────
// Tests — Trinity Constants (IGLA-GF16 Module 1)
// ─────────────────────────────────────────────────────────────────
const trinity_tests_root = b.createModule(.{
.root_source_file = b.path("src/trinity_constants.zig"),
.target = target,
.optimize = optimize,
});
const trinity_tests = b.addTest(.{
.name = "trinity-constants-tests",
.root_module = trinity_tests_root,
});
const run_trinity_tests = b.addRunArtifact(trinity_tests);

const test_step = b.step("test", "Run all tests");
test_step.dependOn(&run_tests.step);
test_step.dependOn(&run_transcendent_tests.step);
test_step.dependOn(&run_c_abi_tests.step);
test_step.dependOn(&run_trinity_tests.step);

// ─────────────────────────────────────────────────────────────────
// Benchmarks
// ─────────────────────────────────────────────────────────────────
const bench_008_module = b.createModule(.{
.root_source_file = b.path("benches/bench_008_fashion_mnist.zig"),
.target = target,
.optimize = optimize,
});
const bench_008 = b.addExecutable(.{
.name = "bench_008_fashion_mnist",
.root_module = bench_008_module,
});
const run_bench_008 = b.addRunArtifact(bench_008);
const bench_008_step = b.step("bench-008", "Run BENCH-008: Fashion-MNIST MLP Quantization Validation");
bench_008_step.dependOn(&run_bench_008.step);

const bench_009_module = b.createModule(.{
.root_source_file = b.path("benches/bench_009_transformer_attention.zig"),
.target = target,
.optimize = optimize,
});
const bench_009 = b.addExecutable(.{
.name = "bench_009_transformer_attention",
.root_module = bench_009_module,
});
const run_bench_009 = b.addRunArtifact(bench_009);
const bench_009_step = b.step("bench-009", "Run BENCH-009: Transformer Attention Pattern Analysis");
bench_009_step.dependOn(&run_bench_009.step);

const bench_step = b.step("bench", "Run all benchmarks");
bench_step.dependOn(&run_bench_008.step);
bench_step.dependOn(&run_bench_009.step);
}
1 change: 1 addition & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ endif()

# Include directory for header-only wrapper
include_directories(
"${CMAKE_SOURCE_DIR}/include"
"${CMAKE_SOURCE_DIR}/../src/c"
"${CMAKE_SOURCE_DIR}/../../src/c"
)
Expand Down
60 changes: 0 additions & 60 deletions cpp/build/CMakeCache.txt

This file was deleted.

1 change: 0 additions & 1 deletion cpp/build/CMakeFiles/cmake.check_cache

This file was deleted.

Loading