Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
39696b6
refactor: remove GPU pipeline and marketing assets — CPU-only focus
Jun 5, 2026
4a57722
feat: WHT multiplication-free ternary kernel + mathematical foundations
Jun 5, 2026
9407302
feat: FWHT kernel + ACDC O(n log n) layer — Level 3
Jun 5, 2026
5d2c780
feat: Tropical Attention (max,+) semiring + CLAUDE.md — Level 4
peder1981 Jun 5, 2026
daaa90f
docs: rewrite README + complete theoretical documentation (Levels 0–5)
peder1981 Jun 5, 2026
0a6bd38
feat: Holographic Reduced Representations (HRR) — Level 5 complete
peder1981 Jun 5, 2026
39f06a1
build: wire L2-L5 math kernels into cmake as OBJECT library
peder1981 Jun 5, 2026
129557d
feat: register L2-L5 kernels in ggml dispatch
peder1981 Jun 5, 2026
658fd0d
feat(acdc): integrate L3 ACDC FFN dispatch via acdc_gemv + env-gated …
peder1981 Jun 6, 2026
e1c95c5
build(submodule): update llama.cpp pointer to 707f316 (L3 ACDC FFN di…
peder1981 Jun 6, 2026
90ae65f
feat(hrr): add hrr_cleanup_iter (Frady 2021) with NAIVE + RESIDUAL modes
peder1981 Jun 6, 2026
30ab330
test(hrr): standalone test_hrr_cleanup.cpp (5/5 PASS) — first C++ ker…
peder1981 Jun 6, 2026
43b2af5
feat(hrr_benchmark): Frady 2021 cleanup_convergence_test + helpers
peder1981 Jun 6, 2026
a7da023
docs(scout): update artifacts to reflect L3-L5 dispatch + HRR refinement
peder1981 Jun 6, 2026
b536d83
build(ci): minimum CI for L2-L5 kernels + integrate test_hrr_cleanup …
peder1981 Jun 6, 2026
a851053
build(submodule): update llama.cpp pointer to 3dfc2df (L5 HRR cleanup…
peder1981 Jun 6, 2026
92dacc4
feat(hrr-dispatch): wire L5 HRR with Frady 2021 cleanup at llama.cpp KQV
peder1981 Jun 6, 2026
7a449c6
docs(scout): mark L5 HRR cleanup end-to-end integration as complete
peder1981 Jun 6, 2026
e7edb21
fix(wht): correct g0/g3 group labels in wht_dot_avx2 + add test_wht
peder1981 Jun 6, 2026
ed6fbde
fix(acdc): drop 1/n² normalization in acdc_forward_i8 + add test_acdc
peder1981 Jun 6, 2026
8509cff
test(tropical): rewrite test_tropical.cpp to match current API
peder1981 Jun 6, 2026
a884036
build(tests): wire all 4 kernel unit tests into CMake + CI
peder1981 Jun 6, 2026
ed7f12b
docs(scout): update to reflect 14 new commits (L3 FFN + L5 cleanup + …
peder1981 Jun 6, 2026
cdce725
refactor: extract bitnet_next_pow2 to shared header (DRY across L3+L5)
peder1981 Jun 6, 2026
e8d45f1
test(hrr-attn): add dispatch-kernel validation for hrr_attention_full
peder1981 Jun 6, 2026
3f8166a
feat(bench): add cpu_universal_benchmark.py for systematic L1-L5 smok…
peder1981 Jun 6, 2026
18fcf75
docs(scout): v0.1.0 CPU-Universal release candidate + 6-test suite
peder1981 Jun 6, 2026
b693d94
fix(ci): vendor L3/L5 dispatch patches — Eddie-Wang1120 force-pushed …
peder1981 Jun 6, 2026
3f7c594
docs(session): add fresh-clone verification + post-session CI fix log
peder1981 Jun 6, 2026
3ec76b6
perf(dispatch): parallelize L4/L5 attention callbacks across heads
peder1981 Jun 6, 2026
e9c00ef
feat(attn): add float sparse top-K attention (BITNET_SPARSE_TOPK)
peder1981 Jun 6, 2026
60a3d1e
docs(session): persist 2026-06-06 session — parallelization + sparse …
peder1981 Jun 6, 2026
a483bbd
test(sparse-attn): add 5/5 unit tests for sparse_attention_float + lo…
peder1981 Jun 6, 2026
ec2a654
Phase C: K_i8 KV cache for tropical attention (3-pass K → 1-pass K)
peder1981 Jun 6, 2026
47ecfd1
docs(session): persist 2026-06-06c — Phase C K_i8 cache, +7.1pp on tr…
peder1981 Jun 6, 2026
b4983b5
docs(reversa): update scout artifacts — Phase C K_i8 cache, 8/8 ctest…
peder1981 Jun 6, 2026
fcf1d4d
Phase A: ACDC diagonal extraction script (d* = diag(H·W·H) / n²)
peder1981 Jun 6, 2026
dd080cc
docs(session): persist 2026-06-06d — Phase A ACDC diagonal extraction
peder1981 Jun 6, 2026
1be84ef
docs(findings): aggregate 5-level research, 4 bugs, 50 tests, bench t…
peder1981 Jun 6, 2026
4b7816a
docs(session): persist 2026-06-06e — Phase E technical writeup done
peder1981 Jun 6, 2026
68971e2
fix(ci): install safetensors via pip (not in Ubuntu 24.04 apt)
peder1981 Jun 6, 2026
533ac93
feat(foundation): reversa state + Fase 1 (Preparação) for 001-trilha-…
peder1981 Jun 7, 2026
bc3669e
test(fase-2): property-based tests + air-gapped + cross-validation
peder1981 Jun 7, 2026
4e1eb57
docs(fase-3): canonical docs + D4 examples + bench CLI + Doxygen
peder1981 Jun 7, 2026
88867e6
feat(fase-4): CMake/CI/README integration + benchmarks stub
peder1981 Jun 7, 2026
9a7b2fd
docs(fase-5): verification report + polimento final
peder1981 Jun 7, 2026
9d2b0ff
docs(session): registra SESSAO 2026-06-06f — PR upstream + blocker CI
peder1981 Jun 7, 2026
4ad5ad6
fix(kv-cache): add d param to _get; auto-reinit on head_dim mismatch
peder1981 Jun 7, 2026
7d8e288
chore: exclude Testing/ ctest artifacts from git
peder1981 Jun 7, 2026
62c5e91
docs(session): registra SESSAO 2026-06-07 — Falcon3-1.58bit + fix hea…
peder1981 Jun 7, 2026
595ba21
docs(bench): tabela comparativa 3 modelos × L1-L5 + análise escala FFN
peder1981 Jun 7, 2026
a5f8220
feat(bench): v0.2.0 — tabela comparativa 3 modelos × L1-L5 (F1.5 comp…
peder1981 Jun 7, 2026
b7b951c
feat(fase-2): ACDC retangular — H_P·diag(d)·H_P para projeções FFN
peder1981 Jun 7, 2026
cbe33f0
feat(fase-3): wire ACDC rect FFN na path de inferência do llama.cpp
peder1981 Jun 7, 2026
74ada9b
docs(session): registra SESSAO 2026-06-07b — Fase II ACDC rect + Fase…
peder1981 Jun 7, 2026
34ee9bf
feat(fase-5): acdc_project_rect — XOR-convolution O(m·n + P log P)
peder1981 Jun 7, 2026
947cd65
fix(ci): submodule → public 1f86f05, patch 04 cumulativo L3+L5+L4+Fas…
peder1981 Jun 7, 2026
585b586
feat(bench): v0.3.0 — ACDC rect 3 modelos × d=0/rand (Fase VI)
peder1981 Jun 7, 2026
d917147
feat(dir1): Direction #1 — real d* extraction + dispatch sidecar + pa…
peder1981 Jun 7, 2026
706ffe5
docs(session): registra SESSAO 2026-06-07c — Direção #1 + patch 05 + …
peder1981 Jun 7, 2026
25fc6b0
perf(fwht): AVX2 in-register prefix for h=1,2,4 — 2× speedup at n=32768
peder1981 Jun 7, 2026
c022916
docs(session): registra SESSAO 2026-06-07d — FWHT AVX2 prefix + bench…
peder1981 Jun 7, 2026
352fa0b
exp(fwht): FWHT OMP parallel — implemented + benchmarked + finding do…
peder1981 Jun 7, 2026
ea16c5a
perf(neon): NEON in-register prefix for h=1,h=2 — mirrors AVX2 optimi…
peder1981 Jun 7, 2026
03ac1c7
feat(hrr): phasor key public API — hrr_phasor_key_init + hrr_phasor_inv
peder1981 Jun 7, 2026
3918e42
feat(tropical): adaptive-K sparse attention — dynamic K via cumulativ…
peder1981 Jun 7, 2026
9eb24bf
docs(direção-a): spec de treinamento ACDCLite — fecha prerequisito do…
peder1981 Jun 7, 2026
360156e
feat(direção-e): CPU-RAG flat-index ANN engine (Level 6)
peder1981 Jun 7, 2026
e09321b
fix(ci): corrige aplicação de patches — usa só o patch 05 combinado
peder1981 Jun 7, 2026
a79df01
refactor(tests): move test_*.cpp/py da raiz para tests/
peder1981 Jun 7, 2026
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
104 changes: 104 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# ─── BitNet CPU kernel CI ──────────────────────────────────────────────────────
#
# Builds the bitnet.cpp project with all L2-L5 math kernels enabled and runs
# the kernel unit test suite. No model download (full smoke/perplexity happens
# locally or in a separate nightly workflow).
#
# Why this exists:
# - Clang ≥ 18 is required for SIMD kernels (per CLAUDE.md).
# - 3rdparty/llama.cpp is a fork (branch `merge-dev`); submodule init is
# critical for the build.
# - GCC 14 may not be installed in the runner image; we explicitly install
# libstdc++-14-dev so Clang 18 can find its system C++ headers.
#
# Trigger: every push to main, every PR.

name: kernel-ci

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
build-and-test:
name: build + test (Ubuntu, clang-18)
runs-on: ubuntu-24.04
timeout-minutes: 30

steps:
- name: Checkout (with submodules)
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 1

- name: Apply dispatch patch (combined 05)
run: |
echo "Applying combined patch 05 (L3 ACDC + L5 HRR + L4 K_i8 cache + FaseIII rect + LLaMA gate)..."
chmod +x ./scripts/apply-dispatch-patches.sh
./scripts/apply-dispatch-patches.sh
echo "Verifying idempotence..."
./scripts/apply-dispatch-patches.sh --check
shell: bash

- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
clang-18 \
cmake \
ninja-build \
libstdc++-14-dev \
python3 \
python3-pip \
python3-scipy \
python3-numpy

- name: Install safetensors (PyPI only; not in Ubuntu 24.04 apt)
run: python3 -m pip install --break-system-packages --no-cache-dir safetensors

- name: Configure (Release, all kernels)
run: |
cmake -B build -G Ninja \
-DCMAKE_C_COMPILER=clang-18 \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DCMAKE_BUILD_TYPE=Release \
-DBITNET_L2_WHT=ON \
-DBITNET_L3_ACDC=ON \
-DBITNET_L4_TROPICAL=ON \
-DBITNET_L5_HRR=ON \
-DBITNET_L6_RAG=ON \
-DBITNET_BUILD_TESTS=ON

- name: Build (compiles L1 + L2-L6 + dispatch into libggml)
run: cmake --build build --config Release -j$(nproc)

- name: Build all kernel unit tests
run: cmake --build build --config Release -j$(nproc) --target test_bitnet_common test_wht test_acdc test_tropical test_sparse_attention test_kv_i8_cache test_hrr_cleanup test_hrr_attention test_acdc_properties test_l4_sparse_properties test_hrr_properties test_dense_is_default test_acdc_rect test_adaptive_k test_rag_retrieval

- name: ctest (runs all add_test() targets — common, L2, L3, L4, L4_sparse, L4_cache, L4_adaptive, L5_attn, L5_cleanup, 4 property tests, dense-is-default, acdc_rect, L6_rag)
run: cd build && ctest --output-on-failure

- name: Air-gapped boot test (AC-11, NO-07)
# Verifies that the built llama-cli binary runs without making any
# network syscalls. This enforces persona D4 (no telemetry, no cloud)
# at the CI level. The script is in tests/test_air_gapped_boot.sh;
# it auto-skips if no model file is provided (which is the case in CI).
# Result: SKIPPED is acceptable in CI; PASS requires a real model and
# is expected in the local release workflow.
run: |
if [ -x tests/test_air_gapped_boot.sh ]; then
chmod +x tests/test_air_gapped_boot.sh
bash tests/test_air_gapped_boot.sh 2>&1 | tee /tmp/air_gapped.log
# Exit code 0 if PASS or SKIPPED, 1 if FAIL
rc=${PIPESTATUS[0]}
if [ $rc -ne 0 ]; then
echo "::warning::air-gapped boot test FAILED (rc=$rc); see /tmp/air_gapped.log"
exit $rc
fi
else
echo "::warning::tests/test_air_gapped_boot.sh not executable; skipping"
fi
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ __pycache__/
poetry.toml

build/
logs/
build_tests/
logs/Testing/
57 changes: 57 additions & 0 deletions .reversa/active-requirements.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"schema-version": 1,
"feature-dir": "_reversa_forward/001-trilha-rigor-produto",
"feature-id": "001",
"short-name": "trilha-rigor-produto",
"started-at": "2026-06-06T19:49:10Z",
"current-stage": "audit",
"stages-completed": ["requirements", "clarify", "plan", "to-do", "audit"],
"paused-features": [],
"last-updated": "2026-06-06T20:57:23Z",
"last-clarify": {
"date": "2026-06-06",
"questions-asked": 4,
"questions-answered": 4,
"open-duvidas": 0,
"monitoring-triggers": ["LR-01 (D2 trigger)", "LR-02 (D3 reavaliação Q4 2029)", "LR-03 (D4 persona)"]
},
"last-plan": {
"date": "2026-06-06",
"artifacts": ["roadmap.md", "investigation.md", "data-delta.md", "onboarding.md"],
"interfaces-omitted": true,
"decisions": 12,
"principles-checked": 7,
"conflicts": 0,
"milestones-defined": 5,
"sub-milestones-defined": 3
},
"last-to-do": {
"date": "2026-06-06",
"version": "1.1 (post-audit fix)",
"total-actions": 36,
"parallel-actions": 20,
"phases": {
"preparacao": 4,
"testes": 8,
"nucleo": 12,
"integracao": 7,
"polimento": 5
},
"conditional-actions-gate-d2": ["T009", "T018", "T019", "T034"],
"longest-dependency-chain": "T005 -> T024 -> T033 (3 levels)"
},
"last-audit": {
"date": "2026-06-06",
"findings-initial": 11,
"findings-resolved": 3,
"findings-open": 8,
"open-by-severity": {
"critical": 0,
"high": 2,
"medium": 4,
"low": 2
},
"resolved-ids": ["A001", "A004", "A011"],
"ready-for-coding": true
}
}
15 changes: 15 additions & 0 deletions .reversa/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[specs]
layout = "feature-folder"
granularity = "feature"
custom_folders = []
scout_suggestion = ""
decided_at = "2026-06-06T16:30:00Z"

[project]
name = "BitNet CPU-Universal"
output_folder = "_reversa_sdd"
forward_folder = "_reversa_forward"

[user]
name = ""
chat_language = "pt-BR"
Loading