diff --git a/docs/experiments/2026-10-28-s0-7c-vanilla-predicate-dump.md b/docs/experiments/2026-10-28-s0-7c-vanilla-predicate-dump.md new file mode 100644 index 00000000..8fe3fdbc --- /dev/null +++ b/docs/experiments/2026-10-28-s0-7c-vanilla-predicate-dump.md @@ -0,0 +1,127 @@ +# S0.7c Vanilla predicate dump (STRA-307): both outputs produced on the server + +Date: 2026-10-28. Item: STRA-307, part of STRA-245. Branch `claude/stra-307`, created from `claude/merge-opt` (2457d81d). +Evidence level: COMPONENT, item (d) of the `vanilla_cpu_family` block (ARCHITECT comment 395f0394, section 2). +This page replaces the first attempt (commit e94369a1, outcome "build unavailable": no cmake, root filesystem full). Attempt 2 built +the tool with the server's g++ directly and put the run root on `/data`. + +## Limit of this evidence (fixed wording) + +This dump proves the predicate of the pin's source, not the release binary. The pin is app 0.2.5 / engine 0.1.50, the comparator is called +release 0.2.6 / engine 0.1.50 (`docs/laptop-vs-vanilla.md` header); STRA-247 records the printed version and digest of the installed +vanilla build. Nothing on this page says anything about the installed vanilla executable. + +## Result in one line + +On the server (AMD Ryzen 9 9950X3D), the pin's own predicate `cpu_avx512_ok()` prints `avx512 1` with all `STRATA_*` variables scrubbed +and `avx512 0` with `STRATA_FORCE_AVX2=1`. The two outputs differ in that one flag and in no other line (51 lines each; `diff` shows one +changed line). The IQ env state is `-` (unset) in both runs. + +## Pin, source and build (AC1) + +| Field | Value | +| --- | --- | +| Pin read from `docs/upstream.md` (this branch) | `41cf05a06a25dd29103b7b27a2279a3f60c21876` (engine 0.1.50, app 0.2.5), short `41cf05a0` | +| engine/strata path used (local) | `C:\Users\pavel\work\leleka\.git\wt\stra-307\engine\strata`, the branch worktree `.git/wt/stra-307` at commit e94369a1 (checked out from `claude/merge-opt`); never the main checkout, which is at the old pin `d9ab8435` (ARCHITECT A9) | +| How it reached the server | `git -c core.autocrlf=false archive HEAD engine/strata/{CMakeLists.txt,cmake,include,src,third_party}` from that worktree, extracted to `/data/leleka-e2e/runs/stra-307/src/engine/strata` | +| llama.cpp / ggml | `3cf03257f219afbe7334045ff7c6a06ac68c627d` (equals `third_party/ggml/VERSION.txt` and the `GIT_TAG` in `CMakeLists.txt`), `git fetch --depth 1` of that SHA into `/data/leleka-e2e/runs/stra-307/llama.cpp`; `git rev-parse HEAD` there prints the same SHA; ggml 0.24.0 | +| Tool | `iq_avx2_parity` (`src/kernels/cpu/iq_avx2_parity.cpp`, target at `CMakeLists.txt` lines 1871-1872); the predicate lines are 556-558 | +| Compiler | GNU g++ / gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0 | +| Target triple | `x86_64-linux-gnu` (`g++ -dumpmachine`) | +| GGML_NATIVE | ON: ggml-cpu compiled with `-march=native` (the CMake default; `STRATA_PORTABLE` is not set, so the `GGML_NATIVE OFF` branch is not taken) | +| STRATA_PORTABLE | OFF (the option default; also `STRATA_ISA_FLOOR` empty) | +| Build type flags | `-O3 -DNDEBUG` (Release, the project default), C++20 for the engine sources, C++17 for ggml-cpu, `-std=gnu11` for ggml C | +| Run root | `/data/leleka-e2e/runs/stra-307` (outside Git, on `/data`); the root filesystem was not written to | +| Binary | `/data/leleka-e2e/runs/stra-307/build/iq_avx2_parity`, sha256 `5d1b5132ab5e9b2671279aa5fae57c8c0b08dc8313619a4623a33fcab8628275` | + +### Deviation from the AC1 wording (stated, not hidden) + +AC1 asks for `cmake --build --target iq_avx2_parity` to exit 0 and for the values to be read "from the CMake cache". The +server has no `cmake` (attempt 1), and installing it was not allowed (orchestrator decision on STRA-307, comment 91a3354e: build with +the server's g++ directly, same route as STRA-248). So: + +- the tool was built by `/data/leleka-e2e/runs/stra-307/build.sh`, which runs 42 `g++`/`gcc` compile commands and an `ar` + link step + by hand and exits 0 (it printed only the `ls -l` of the binary; `compile.log` and `link.log` are both 0 bytes); +- there is **no CMake cache**. The compiler id/version, triple and GGML_NATIVE / STRATA_PORTABLE state above come from `g++ --version`, + `g++ -dumpmachine` and from the flags the script passes, which were transcribed from `engine/strata/CMakeLists.txt` (lines 1689-1730, + 1738-1851: the `strata_kernels_cpu` sources and their per-file ISA flags, the AVX-VNNI define, the ggml static build with + `GGML_OPENMP` off, `GGML_CPU_REPACK` on, llamafile off, `GGML_SCHED_MAX_COPIES=4`) and from ggml's `CMakeLists.txt` (x86 branch, + `GGML_NATIVE` gives `-march=native`); +- `STRATA_AVXVNNI=1` was set by hand for `q2_avx2.cpp` and `iq_avx2.cpp`; CMake would have set it from a compile check of the + intrinsics, which g++ 15.2.0 passes (the files compiled without error with it); +- the project's warning flags were not passed (they do not change code generation); this is a hand-made equivalent of the CMake + build, not a CMake build, and a reader who needs the exact CMake artifacts must repeat the build where cmake >= 3.24 exists. + +The predicate itself (`cpu_avx512_ok()` in `src/kernels/cpu/expert_layout.cpp`, from line 42) is the `STRATA_FORCE_AVX2` environment +check, the ISA-cap check and a CPUID/XCR0 test; it does not depend on how the rest of the engine was compiled. + +## The two runs (AC2), no model, CPU only + +Both runs: `env -i PATH=/usr/bin:/bin ...` (so no `STRATA_*` variable of the login shell can leak in), working directory +`/data/leleka-e2e/runs/stra-307`, exit status 0, 0.13 s each. Raw outputs are outside Git at `run_scrubbed.txt` (sha256 +`8973213c9b9bca74ffbec08f6f57da9d595e5974e801cce6270457d7f9b19086`) and `run_force_avx2.txt` (sha256 +`19da2a92f5be123398e6477d0eae6d0ef9adbbdb1dc12d5bf9378cf4d628b751`) in that directory. + +### Run A: all STRATA_* scrubbed (the shipped state) + +Command: `env -i PATH=/usr/bin:/bin ./build/iq_avx2_parity`. First three lines, verbatim: + +``` +iq_avx2_parity: AMD Ryzen 9 9950X3D 16-Core Processor (avx2 1, avx512 1), CPU -1, core type 00h + STRATA_IQ256_GATHER -, STRATA_NO_AVXVNNI -, STRATA_IQ_MT_MIN -, STRATA_IQ_PREFETCH - + variants this CPU runs: gather+vnni; this thread's: vnni +``` + +Last line, verbatim: `iq_avx2_parity: 0 failures` + +### Run B: STRATA_FORCE_AVX2=1 + +Command: `env -i PATH=/usr/bin:/bin STRATA_FORCE_AVX2=1 ./build/iq_avx2_parity`. First three lines, verbatim: + +``` +iq_avx2_parity: AMD Ryzen 9 9950X3D 16-Core Processor (avx2 1, avx512 0), CPU -1, core type 00h + STRATA_IQ256_GATHER -, STRATA_NO_AVXVNNI -, STRATA_IQ_MT_MIN -, STRATA_IQ_PREFETCH - + variants this CPU runs: gather+vnni; this thread's: vnni +``` + +Last line, verbatim: `iq_avx2_parity: 0 failures` + +### Difference between the two outputs + +`diff run_scrubbed.txt run_force_avx2.txt`, verbatim: + +``` +1c1 +< iq_avx2_parity: AMD Ryzen 9 9950X3D 16-Core Processor (avx2 1, avx512 1), CPU -1, core type 00h +--- +> iq_avx2_parity: AMD Ryzen 9 9950X3D 16-Core Processor (avx2 1, avx512 0), CPU -1, core type 00h +``` + +The two outputs differ in exactly the avx512 predicate. The parity lines in between (rows against ggml's dot, the scalar / gather / +vnni variants, 0 failures) are identical in both runs, because the tool checks the AVX2 i-quant variants either way. + +## What this tells and what it does not + +- Tells: in the pin's source, on this CPU, `cpu_avx512_ok()` is true by default and `STRATA_FORCE_AVX2=1` turns it off; the IQ env + variables the tool prints (`STRATA_IQ256_GATHER`, `STRATA_NO_AVXVNNI`, `STRATA_IQ_MT_MIN`, `STRATA_IQ_PREFETCH`) are unset in the + shipped state. It is the engine's own predicate, as printed by the engine's own code. +- Does not tell: which kernel family the installed vanilla executable selected (STRA-247's negative line plus positive control carry + that), and it does not say which family any release other than the pin would select. The pin is not the comparator release. +- The i-quant gating state beyond these four variables (for example which of the AVX-512 or AVX2 i-quant rows a model run takes) is not + printed by this tool without a model, and nothing is inferred here. + +## Acceptance state + +| AC | State | Evidence | +| --- | --- | --- | +| AC1 | met with the deviation above | binary built, link exit 0; pin, compiler, triple, GGML_NATIVE, STRATA_PORTABLE and the worktree path recorded; no CMake cache exists | +| AC2 | met | both outputs quoted verbatim; avx512 flag 1 then 0; the outputs differ in that line only | +| AC3 | met | the fixed sentence above appears once; the forbidden phrases appear 0 times | +| AC4 | met | `git diff --name-only ..HEAD` lists this page only | +| AC5 | not applicable | the build was possible, so no "unavailable" rows remain | + +## Not verified + +No CMake configure was run (no cmake on the server). No model was loaded, nothing ran at 256k, no GPU job was started or disturbed +(GPU 0 percent, 2 MiB used before the build). The build used 8 parallel compile jobs for 17 s; no timing job ran meanwhile. +The root filesystem of the server is still 100 percent full (2.5 GB free), unchanged by this work; that is a separate server-health item.