physics-mv
FORGE: request-bound machine realization, providers and verification for AienOS. Host, simulated and GB10 hardware paths have separate evidence.
Brought by drakestapleton
GitHub aien-dev/physics-mv#98 (code only)
Apply it
git checkout -b patch-66ec44022512ec10 ef451582076d0b9c1315144e05751e1b719f171e curl -fsSL https://interplane.io/drakestapleton/physics-mv/patches/66ec44022512ec10.patch | git am
Provenance
github-import 1
aien-dev/physics-mv
98
38d33b4e089b4cadd46d4365e908ec7ad810145a
{"kind":"github-import","owner":"aien-dev","repo":"physics-mv","number":98,"url":"https://github.com/aien-dev/physics-mv/pull/98","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:39:30Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/README.md b/README.md index 3d3d52f..6973aa8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +<!-- github-native-navigation --> +[Source](https://github.com/aien-dev/physics-mv) · [Walkthrough](TEACHING.md) · [Replay receipt](TEACHING-REPLAY.txt) · [Issues](https://github.com/aien-dev/physics-mv/issues) · [Actual tags](https://github.com/aien-dev/physics-mv/tags) +<!-- /github-native-navigation --> + # PHYSICS Two things live here: the **FORGE** machine realization layer (C), and the historical **Atlas / PHYSICS boot artifacts** (AArch64 assembly) with their evidence. FORGE turns a verified Omega meaning into a concrete realization on the machine at hand (today the CPU and the NVIDIA GB10 GPU; a simulated analog provider exists for testing). It is realization and lowering, not a security gatekeeper: AEGIS verifies, and AIENOS owns the trusted substrate. This repository also holds `nvrm/`, the small C client that drives the GB10 directly through the open NVIDIA kernel interface (no CUDA). @@ -12,6 +16,22 @@ ATLAS AWAKENS. AIEN PROPOSES. OMEGA DEFINES. FORGE REALIZES. AEGIS VERIFIES. HAR Historical `PHYSICS_*` milestone names (for example `PHYSICS_BOOT`) are unchanged in evidence. The subsystem role was renamed FORGE by ADR 0014 in aien-architecture. The repository itself is still named `physics`: the planned rename to `forge` (aien-architecture `CURRENT_EXECUTION_PLAN.md`, step A2) has not been done. +## How it works / how we built it: a small result you can reproduce + +**Problem.** A backend that lowers an Omega meaning to machine code must not be the party that declares the code safe for a machine. FORGE therefore *proposes* a realization and AEGIS *verifies* it. Only a verified realization reaches the GPU client (`nvrm/`). ADR 0014 records this boundary. + +**Mechanism.** +1. A `ForgeRealizationRequest` carries a program digest, an opcode count, IR bytes and a target [machine descriptor](forge/forge_descriptor.h). +2. [`forge_realize`](forge/forge_realize.c) checks the descriptor digest and lowers to an aligned code buffer with request, code and realization digests. +3. [`aegis_verify_realization`](forge/forge_realize.c) recomputes the request digest and checks code size, machine limits and descriptor binding. +4. [`forge_submit_realization`](forge/forge_realize.h) accepts only a verified realization, and refuses before any NVRM call otherwise. + +**Limitation and failed approach.** Until [b0f7308](https://github.com/aien-dev/physics-mv/commit/b0f7308) (physics#53/#54), verification took the request but never compared it with the result. A valid result realized for program A therefore also verified for program B. The host test [`tests/test_forge_aegis_host.c`](tests/test_forge_aegis_host.c) now refuses that replay. The AEGIS token is a public constant: an integrity marker, not authentication. + +**Evidence classes.** The host seam is implemented and gated, and needs no GPU. The analog provider is a simulation. The boot receipts are from QEMU. None of these is GB10 execution. For the GPU tutorial see [CUDA++ (aien-dev/CUDApp)](https://github.com/aien-dev/CUDApp). + +[The worked lesson](TEACHING.md) narrates each stage with its source and runs `tests/gates/run.sh forge-aegis` offline: exit 0, `TOTAL=13 PASSED=13 FAILED=0`, including `NEG_RESULT_REPLAYED_TO_OTHER_PROGRAM_REFUSED`. [The replay record](TEACHING-REPLAY.txt) shows a GPU-free host result. + ## Current state Research-grade and pre-alpha. diff --git a/TEACHING-REPLAY.raw.txt b/TEACHING-REPLAY.raw.txt new file mode 100644 index 0000000..9c299a3 --- /dev/null +++ b/TEACHING-REPLAY.raw.txt @@ -0,0 +1,17 @@ +=== FORGE AEGIS host gates === +PASS build test_forge_aegis_host +=== FORGE AEGIS verifier host checks (no GPU) === +[PASS] KAT_DESCRIPTOR_DIGEST +[PASS] REALIZE_OK +[PASS] VERIFY_OWN_REQUEST_ACCEPTED +[PASS] NEG_RESULT_REPLAYED_TO_OTHER_PROGRAM_REFUSED +[PASS] NEG_RESULT_REPLAYED_TO_OTHER_OPCODE_COUNT_REFUSED +[PASS] NEG_REQUEST_FOR_OTHER_TARGET_REFUSED +[PASS] NEG_CODE_DIGEST_MISMATCH_REFUSED +[PASS] NEG_STALE_IDENTITY_REFUSED +[PASS] NEG_OTHER_DESCRIPTOR_REFUSED +[PASS] NEG_SUBMIT_UNVERIFIED_REFUSED +[PASS] NEG_SUBMIT_BAD_TOKEN_REFUSED +[PASS] NEG_SUBMIT_POST_VERIFY_MUTATION_REFUSED +[PASS] NEG_SUBMIT_WITHOUT_NVRM_REFUSED +FORGE AEGIS host results: TOTAL=13 PASSED=13 FAILED=0 diff --git a/TEACHING-REPLAY.txt b/TEACHING-REPLAY.txt new file mode 100644 index 0000000..73baf8f --- /dev/null +++ b/TEACHING-REPLAY.txt @@ -0,0 +1,25 @@ +# Teaching replay record, 2026-10-22 + +Repository: `aien-dev/physics-mv` +Base source revision: `14273c5ce7d13fbc6e410c4fed9aa36837918177` (fresh detached Spark checkout; documentation branch is a separate checkout) +Host: `spark-b87b`, Linux 7.0.0-1019-nvidia aarch64 +Tools: gcc 13.3.0, git 2.43.0, QEMU 8.2.2, Rust/cargo 1.98.1 (only relevant tools used) +Invocation: `quiet-build` wrapped CPU-heavy compilation where used; it does not change the test's assertion. + +From a fresh checkout detached at the base revision: + +```sh +tests/gates/run.sh forge-aegis +``` + +Observed process exit: `0` +Observed result: FORGE AEGIS host results: TOTAL=13 PASSED=13 FAILED=0 +Raw stdout/stderr: [TEACHING-REPLAY.raw.txt](TEACHING-REPLAY.raw.txt) (SHA-256 `ef934f1e81cc6ab914daf6912bcb7dbdf22047fadb1ddb2d081ce47cfa3e05d2`). + +Source file hashes at the tested base: +- `forge/forge_realize.c`: SHA-256 `e3a369cefa17f623bac35a4b4684fa7f569a134cd1dc6432e6b5061b4f83efc6` +- `forge/forge_descriptor.c`: SHA-256 `57e3d1aac909882a659dbf7586a571c76df49d100bb79d6d2d2a30938611a6be` +- `tests/test_forge_aegis_host.c`: SHA-256 `20c2ab0b15f2113941efbf7d26b61f6b07677257256ff98ce3b5f386cccd1cdf` +- `tests/run_forge_aegis_host_gates.sh`: SHA-256 `6aa34ade6b4ca8bf6466983c88e6170677b3d7f10ba4a91f08570e8a1025ee51` + +Limits: this is a scoped fixture, not a qualification of unrelated gates or physical hardware. The Omega program fixture is separate from OSC source compilation. No model was loaded. diff --git a/TEACHING.md b/TEACHING.md new file mode 100644 index 0000000..d15a50f --- /dev/null +++ b/TEACHING.md @@ -0,0 +1,53 @@ +# A realization request and its refusal + +I 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. + +The [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. + +## Replay + +Use 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). + +```sh +git clone https://github.com/aien-dev/physics-mv.git physics-lesson +cd physics-lesson +git checkout --detach ef451582076d0b9c1315144e05751e1b719f171e +tests/gates/run.sh forge-aegis +``` + +The 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`. + +This is a host seam test. It does not establish other things: +- The analog provider is a simulation. +- The older assembly boot receipts are QEMU evidence. +- Neither shows a current physical GB10 execution. + +Hardware routes remain separate in [README.md](README.md) and [the gate manifests](tests/gates). + +### The failed approach, replayed + +Before [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: + +```sh +git show b0f7308^:forge/forge_realize.c > forge/forge_realize.c # scratch checkout only +tests/gates/run.sh forge-aegis +``` + +The expected exit is 1, with `FORGE AEGIS host results: TOTAL=13 PASSED=10 FAILED=3`. The three checks that FAIL are: +- `NEG_RESULT_REPLAYED_TO_OTHER_PROGRAM_REFUSED` +- `NEG_RESULT_REPLAYED_TO_OTHER_OPCODE_COUNT_REFUSED` +- `NEG_REQUEST_FOR_OTHER_TARGET_REFUSED` + +A result for program A verified for program B, which is the defect physics#53 fixed. + +### Boundaries + +- **Omega** defines the meaning; FORGE receives only its digest and IR. +- **AEGIS** verification is the only route to a `ForgeVerifiedRealization`. +- **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. +- **The GPU programming tutorial** lives in [CUDA++ (aien-dev/CUDApp)](https://github.com/aien-dev/CUDApp) and is not repeated here. + + +### Parent fresh-checkout replay + +A 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. diff --git a/docs/parent-replay-2026-10-22.txt b/docs/parent-replay-2026-10-22.txt new file mode 100644 index 0000000..013efe2 --- /dev/null +++ b/docs/parent-replay-2026-10-22.txt @@ -0,0 +1,38 @@ +2026-10-22 parent coordination replay +Repository: aien-dev/physics-mv +Exact executable source: 14273c5ce7d13fbc6e410c4fed9aa36837918177 +Observed exit: 0; expected by the documented bounded recipe: 0 +Scope: Host FORGE/AEGIS seam passed 13/13; no GPU qualification + +This is a separate fresh temporary checkout, not reuse of the author build directory. Git objects may be shared as immutable source storage; compiled outputs were not copied. The original author receipt is preserved. This replay is not a fresh-context source review, full repository suite, protected-branch admission, live service check, security audit or physical-hardware qualification. The website's nonzero baseline is a retained FAIL, not a passing product build. Missing implementation inspections remain absence checks, not executed features. +Host: Spark Linux7.0.0-1019-nvidia aarch64; relevant tool versions appear below. Builds were run serially via quiet-build. + +RAW OBSERVED OUTPUT: +PARENT FRESH REPLAY +REPO aien-dev/physics-mv +SOURCE 14273c5ce7d13fbc6e410c4fed9aa36837918177 +COMMAND +tests/gates/run.sh forge-aegis + +ENVIRONMENT +Linux aarch64 +gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0 +rustc 1.98.1 (48a229cea 2026-09-01) +14273c5ce7d13fbc6e410c4fed9aa36837918177 +=== FORGE AEGIS host gates === +PASS build test_forge_aegis_host +=== FORGE AEGIS verifier host checks (no GPU) === +[PASS] KAT_DESCRIPTOR_DIGEST +[PASS] REALIZE_OK +[PASS] VERIFY_OWN_REQUEST_ACCEPTED +[PASS] NEG_RESULT_REPLAYED_TO_OTHER_PROGRAM_REFUSED +[PASS] NEG_RESULT_REPLAYED_TO_OTHER_OPCODE_COUNT_REFUSED +[PASS] NEG_REQUEST_FOR_OTHER_TARGET_REFUSED +[PASS] NEG_CODE_DIGEST_MISMATCH_REFUSED +[PASS] NEG_STALE_IDENTITY_REFUSED +[PASS] NEG_OTHER_DESCRIPTOR_REFUSED +[PASS] NEG_SUBMIT_UNVERIFIED_REFUSED +[PASS] NEG_SUBMIT_BAD_TOKEN_REFUSED +[PASS] NEG_SUBMIT_POST_VERIFY_MUTATION_REFUSED +[PASS] NEG_SUBMIT_WITHOUT_NVRM_REFUSED +FORGE AEGIS host results: TOTAL=13 PASSED=13 FAILED=0