interplane.Get Omega
Read in your language

physics-mv

FORGE: request-bound machine realization, providers and verification for AienOS. Host, simulated and GB10 hardware paths have separate evidence.

Brought by drakestapleton

branch main Branches Tags History

physics-mv / TEACHING.md

53 lines · 4547 bytes Raw Blame History Rendered
1# A realization request and its refusal
2
3I separated machine realization from semantic authority so a backend can propose machine code without declaring it safe. The name FORGE and this boundary are recorded in [ADR 0014](https://github.com/aien-dev/aien-architecture-mv/blob/main/docs/adr/0014-rename-machine-physics-to-forge.md); this repository still has its historical `physics` name. The host seam here is implemented, but the sample lowering is deliberately simulated, not a GB10 instruction generator.
4
5The [host fixture](tests/test_forge_aegis_host.c) builds a `ForgeRealizationRequest` with program digest, opcode count, IR bytes and a target [machine descriptor](forge/forge_descriptor.h). [`forge_realize`](forge/forge_realize.c) checks the descriptor digest, pads a copy of IR to an aligned code buffer and computes request, code and realization digests. [`aegis_verify_realization`](forge/forge_realize.c) checks code size, machine limits, descriptor and request binding, then marks the result verified. A result for program A is refused when replayed for program B or a different opcode count. Mutated code, a stale identity and another target descriptor are also refused. The token in this seam uses a public constant and is an integrity marker, not authentication against a caller able to recompute it. The submit-side fixture verifies refusals before NVRM access. This particular seam fixture does not select a physical provider; [the form realization layer](forge/form/forge_form.c) holds that separate choice, and [the analog simulation fixture](tests/test_forge_analog_sim.c) checks its simulated provider against an oracle. The [V2 descriptor specification](docs/FORGE_SUBSTRATE_V2_SPEC.md) explains the serialized machine boundary.
6
7## Replay
8
9Use a fresh checkout on a Linux host with gcc, git and bash. The test needs no GPU, model, sibling repository, QEMU or network after the clone. The four source files under test (`forge/forge_realize.c`, `forge/forge_descriptor.c`, `tests/test_forge_aegis_host.c` and `tests/run_forge_aegis_host_gates.sh`) are byte-identical between `14273c5c` (the receipted replay) and `ef451582` (main on 2026-11-05).
10
11```sh
12git clone https://github.com/aien-dev/physics-mv.git physics-lesson
13cd physics-lesson
14git checkout --detach ef451582076d0b9c1315144e05751e1b719f171e
15tests/gates/run.sh forge-aegis
16```
17
18The expected exit is 0, with all 13 checks PASS and the final line `FORGE AEGIS host results: TOTAL=13 PASSED=13 FAILED=0`. The checks include `REALIZE_OK`, `VERIFY_OWN_REQUEST_ACCEPTED` and `NEG_RESULT_REPLAYED_TO_OTHER_PROGRAM_REFUSED`. See my [raw replay](TEACHING-REPLAY.txt) for the observed output and environment at `14273c5c`.
19
20This is a host seam test. It does not establish other things:
21- The analog provider is a simulation.
22- The older assembly boot receipts are QEMU evidence.
23- Neither shows a current physical GB10 execution.
24
25Hardware routes remain separate in [README.md](README.md) and [the gate manifests](tests/gates).
26
27### The failed approach, replayed
28
29Before [b0f7308](https://github.com/aien-dev/physics-mv/commit/b0f7308), `aegis_verify_realization` took the request but never compared it with the result. Put that version back in a scratch checkout and the same test catches it:
30
31```sh
32git show b0f7308^:forge/forge_realize.c > forge/forge_realize.c # scratch checkout only
33tests/gates/run.sh forge-aegis
34```
35
36The expected exit is 1, with `FORGE AEGIS host results: TOTAL=13 PASSED=10 FAILED=3`. The three checks that FAIL are:
37- `NEG_RESULT_REPLAYED_TO_OTHER_PROGRAM_REFUSED`
38- `NEG_RESULT_REPLAYED_TO_OTHER_OPCODE_COUNT_REFUSED`
39- `NEG_REQUEST_FOR_OTHER_TARGET_REFUSED`
40
41A result for program A verified for program B, which is the defect physics#53 fixed.
42
43### Boundaries
44
45- **Omega** defines the meaning; FORGE receives only its digest and IR.
46- **AEGIS** verification is the only route to a `ForgeVerifiedRealization`.
47- **The GPU client** ([`nvrm/`](nvrm)) is reached only through [`forge_submit_realization`](forge/forge_realize.h). In this fixture every submit is refused before any NVRM call.
48- **The GPU programming tutorial** lives in [CUDA++ (aien-dev/CUDApp)](https://github.com/aien-dev/CUDApp) and is not repeated here.
49
50
51### Parent fresh-checkout replay
52
53A separate coordination replay is retained in [the parent receipt](docs/parent-replay-2026-10-22.txt). Its scope and observed exit are explicit; source review and final desk qualification remain separate. A recorded absence or expected failing baseline is not a passing implementation.