interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / native / prefetch / README.md

124 lines · 8774 bytes Raw Blame History Rendered
1# Prefetch control classification
2
3This is the result classifier used by `tools/run_gpu_l2d_prefetch_chip.sh` for
4Omega #640. The previous script accepted every nonzero control exit, including
5model construction failures before any numerical comparison. The script now
6calls this native Omega program and refuses a reused evidence directory.
7
8The historical consumer is `tests/gpu_decode_graph_test.c` from Omega main
9`cd5897e3f92f72a015892c67b17f096e433b54f7`. It is a retained C reference, not a
10new native model or device implementation. No historical kernels are changed.
11The classifier targets the script's exact control invocation: two layers,
12vocabulary 151936, position 300, three repetitions, cached weights and
13`--prefetch-red`. This switch leaves the separate receipt field `red` at zero;
14it sets the prefetch-specific switch printed in the log instead.
15
16## Build and invocation
17
18Use the qualified native host compiler. The development qualification consumes
19L788's compiler executable with SHA256
20`1d1aad082539399920bc6c90ff41f0a0c3a1ca3225e518fd0d259e0aeb71732d`.
21It is a proposed compiler dependency, not a compiler merged into this base.
22Its existing reconstruction is documented in the native host/compiler lane.
23
24Compile `classify.om` by feeding its source to that compiler and saving stdout
25to a new executable file. Check compilation succeeds before making it executable.
26The program takes three arguments: observed child exit code, log path, receipt
27path. Run it through `quiet-build` for host qualification. The existing GPU
28script requires `PREFETCH_CLASSIFIER` to name that executable before doing work.
29The script copies the executable into the new evidence directory and verifies
30its digest against `classify.sha256`, then verifies `classify.om` against
31`source.sha256`, before any device work. Those committed digests belong to the
32qualified compiler profile; update them only after requalification.
33GPU execution still requires the established reservation and lock.
34
35| Classifier exit | Output | Meaning |
36| --- | --- | --- |
37| 0 | `PREFETCH_CONTROL: CAUGHT` | Completed control, expected named numerical failure |
38| 1 | `PREFETCH_CONTROL: UNCAUGHT` | Completed control passed; experiment fails |
39| 65 | `PREFETCH_CONTROL: INVALID` | Evidence cannot qualify the control |
40
41Other exits, signals and classifier timeouts are also invalid in the script.
42The script bounds each graph/control/command-list run at 600 seconds and
43the classifier at 10 seconds,
44with bounded termination grace periods. Missing positive logits hashes and failed binary-hash recording also prevent
45a passing experiment.
46
47## Evidence contract
48
49Both input files are bounded to 64 KiB. The log must identify the prefetch
50control, contain all 13 named checks in source order, and end with its matching
51summary. The control is CAUGHT only when the argmax or logits comparison fails
52(slot 4 or 5). The unordered o_proj race also makes graph output differ between
53runs, so C determinism, B versus C, post-mutation C and timeline (slots 3, 7, 10,
5411) may fail with it; these alone never qualify. Setup, A, B execution, both
55mutation controls and timeline off must pass. Child exit, counted failures and
56summary must agree. Three GB10 red runs (2026-10-14, 2026-10-15, 2026-10-31,
57MEASURED) all fail exactly slots 3, 4, 5, 7, 10 and 11; the first classifier
58version accepted only slots 4 and 5 and refused all three as INVALID.
59
60The receipt must be complete JSON in the consumer's emitted ASCII subset:
61objects, arrays, strings without escapes, and finite decimal numbers. Depth is
62bounded to 32. Required top-level fields must occur exactly once, have the
63expected kinds, and carry matching check counts, failure count, verdict and
64invocation settings. The logits hash has exactly 16 lowercase hexadecimal
65characters. Nested comparison flags must match the named argmax result; both
66other mutation controls must report successful execution and caught=true,
67and the batching comparison must report identical=false exactly when slot 7 failed. Unexpected, incomplete, truncated or unsupported output refuses
68qualification. This is not a general JSON library or authentication of supplied
69logs. It consumes trusted child output saved by the existing experiment; it
70does not prove that adversarially fabricated numerical data is genuine.
71
72## Scope
73
74Host classifier verification does not measure prefetch benefit, establish
75CPU/GPU visibility or qualify the actual dependency mutation on hardware.
76The full-token experiment, ownership reconciliation for a new prefetch candidate,
77and hardware correctness/performance requirements of #640 remain open.
78
79## Corrected compiler compatibility
80
81The compiler safety correction in Omega PR676 also reproduces this component
82without changing its executable bytes. See [evidence/prefetch-640/compiler-correction](../../evidence/prefetch-640/compiler-correction/README.md) for the exact compiler/source pins, binary comparisons and fresh host replays. The original qualification remains preserved.
83
84## Automatic host verification
85
86`OMEGA-PREFETCH-NATIVE` now selects this component's actual native tests.
87Its entry is the existing experiment script with `--host-qualification`.
88This mode never enters the GPU experiment. It checks both compiler source and
89executable against `compiler.sha256`, creates private scratch, builds `gate.om`,
90and runs it. The gate itself builds the classifier and the two independent
91fixture generators, executes all53 cases, and compares exact exits and verdict
92bytes. Each child has a30-second deadline. Scratch and child outputs remain
93available for inspection; the shell creates a separate directory on each run.
94
95The required compiler is this branch's seeded `seed/out/omc`, executable
96`26540e6de62402d5784b30b24d7c6faae488137c1f8a4b3e784fd0b5d5528991`, built from
97`seed/omc/omc.om` `9977db63aae76ee41c35a7a5715d7dc40427f3c7711597f31e5b60697ef8e7ef`
98(both pinned in `compiler.sha256`). The original qualification used the corrected
99mapping profile from Omega PR676 commit `1dffceaeb0dd26fb69ea64d367a49a9950c25a62`,
100executable 9f48f66a; the pin moved with each reseed (62775d2a, then 1578b357, then be8c5130,
101then b4f45121, then 3ad9f10f, then b1d9cff6, then 5f90edea, then cfd96b48, then 0f2de851, then 6d1b1cf5, then b87c8b65, then 564c5835, then 6844d173, then 0ed21175, then f4fa7951, then c52e986e, then 1e628c80, then 2495bc25, then a5613368, then 106558ba, then 5fe037d9, then bef974c1, then 46dedc0a, then 26540e6d) and the gate was rerun (no rerun is
102recorded for b1d9cff6, 6d1b1cf5 or b87c8b65; at 564c5835 factory bay 1 reran the host gate on
103ham/omc-train e68b5914: 53/53 PASS; at 6844d173 it was rerun on ham/omc-perf-loops-5, at 0ed21175 on ham/om-threads-4, at f4fa7951 on ham/omc-perf-mem-3 at c52e986e on omc/no-caps, at 1e628c80 on omc/perf, at 2495bc25 on omc/inline-edges, at a5613368 on omc/pools, at 106558ba on completion/integrated-20261112, at 5fe037d9 on amdserve/kfd-word-r2, at bef974c1 on amdserve/kfd-queueobj, at 46dedc0a on amdserve/kfd-queueobj and at 26540e6d on amdserve/kfd-aperture). The compilers
104through 3ad9f10f emit the same classifier bytes (b527a20c, pinned in `classify.sha256`). The
105hosted-x86 ABI1 lowering of #1050 changed them: b1d9cff6, 5f90edea, cfd96b48, 0f2de851, 6d1b1cf5, b87c8b65, 564c5835, 6844d173, 0ed21175, f4fa7951, c52e986e, 1e628c80, 2495bc25, a5613368, 106558ba, 5fe037d9, bef974c1, 46dedc0a and 26540e6d emit 5dd5bb47, so the
106chip entry refuses a classifier built with the current pin until `classify.sha256` is requalified
107(the host gate above passes 53/53 with 5f90edea). The entry refuses with 3 for any other compiler. It
108does not fetch code, accept an arbitrary environment compiler, silently select an
109older profile, or waive missing prerequisites.
110
111Native process supervision reuses the existing gate669 pattern from that
112compiler revision. `gate-child.om` is the existing supervisor control fixture.
113Direct `gate.om` invocation takes the absolute compiler path and optionally
114control0/1/2 for wrong exit, self-signal and deadline overrun. Each requires a
115fresh `build/prefetch-native-gate` directory; repeats refuse91. Controlled
116failure exits99 and never emits the success observation. This is trusted host
117qualification, not a security sandbox or process-tree isolation mechanism.
118
119Independent replay passes53 cases and catches all six tested refusal/control
120scenarios. The existing runner passes twice with separate scratch in the exact
121combined candidate. Evidence is in `evidence/prefetch-640/native-gate/`.
122The verification planner must inspect the committed manifest; dirty-file
123preview alone does not load a new manifest. Operator review of pipeline changes
124and all pre-existing gates remain required. No allow-list exemption was added.