phase3: close assembly baseline milestone

This commit is contained in:
Christopher Williams
2026-09-23 18:44:51 -04:00
parent 7b0879f8da
commit 494c6d6c7f
3 changed files with 69 additions and 0 deletions
+4
View File
@@ -11,3 +11,7 @@ A tracked synthetic-tested MODE2/2352 ISO9660 walker/extractor now produces igno
## Phase 2 — Archive, Loader, and Overlay Investigation (2026-09-23)
Phase 2 preserved the original Phase 1 Ghidra program and analyzed an isolated USA working copy, yielding static-only candidate request, lookup/queue, and separate candidate-class transfer paths. PCSX-Redux/GDB was configured reproducibly with both `--gdb` and `--debugger`; two isolated cold boots observed the same entry-state PC `0x800FB368`, SP `0x801FFFF0`, and GP `0x00000000`. A selected no-input startup control produced a repeated bounded negative: the direct candidate did not execute in the documented window, while a predecessor executed once without meeting the conditioned downstream branch. A new synthetic-tested read-only `tools/sf3_probe` safely measured the static/census-supported candidate class; two manifest-integrity-verified reports agreed but remained structurally inconclusive. The final suite passed 28 synthetic-only tests, generated artifacts remained ignored, and the Phase 2 investigation record documents all provenance and limits. No loader, allocation, overlay, archive, table, compression, or general runtime memory-map model was established. Future work requires fresh approval and must not promote these bounded findings beyond their evidence.
## Phase 3 — Matching Build Pipeline, Assembly Baseline, and Compiler Fingerprint (2026-09-23)
Phase 3 verified the local native filesystem prerequisite, added ignored pinned Splat, Maspsx, and locally built GNU MIPS Binutils tooling with recorded provenance, and added a tracked `Makefile` plus synthetic-only fingerprint probe. A clean `make clean && make all` rebuilds `SCUS_946.40;1` byte-for-byte: `cmp` exits 0 and both full-file SHA-1 values are `e173426c157384ebf1b6caf8c6fea18a85a14af9`; the final 28-test synthetic suite passed. The exact baseline is deliberately a payload-data assembly representation, not a recovered source/function/section/object model. Initial code segmentation attempts decoded non-code bytes as unsupported instructions, so they remain unresolved. The synthetic Clang/GNU-as probe is deterministic for its self-authored fixture but cannot fingerprint the original compiler, assembler, linker, flags, ABI, or libraries because no original function/object comparator has been recovered. Phase 4 must start fresh with approved tasks, retain this baseline, and make no C-matching claim without direct evidence and the full-binary gate.
+65
View File
@@ -0,0 +1,65 @@
# PhaseEnd — Phase 3: Matching Build Pipeline, Assembly Baseline, and Compiler Fingerprint
**Date:** 2026-09-23
**Phase Status:** Complete
**Milestone confirmed by developer:** yes
## Completed Checklist
- P3-T1 — Verified the local owner-writable Btrfs worktree and inotify file-change behavior; inventoried available tools and recorded their provenance.
- P3-T2 — Established and synthetically validated ignored Splat and LLVM candidate paths, with a safe-failure check for a mismatched synthetic input hash.
- P3-T3 — Added tracked build orchestration and produced an ignored all-payload assembly representation using local GNU MIPS Binutils.
- P3-T4 — Performed a clean rebuild and exact binary/hash comparison against the validated USA executable.
- Rules check — Re-read `AGENTS.md` mandatory behavior after P3-T4 and stated the required continuation notice.
- P3-T5 — Added and ran a synthetic-only compiler/assembler reproducibility probe; retained the original-toolchain fingerprint as inconclusive.
- P3-T6 — Completed clean test, rebuild, comparison, firewall, and Git-review gates; prepared the developer confirmation gate.
## Verified Results
### Byte-identical assembly baseline
- `make clean` and `make all` each exited 0 from the documented clean state.
- `cmp -s build/scus_946_40.rebuilt extracted/SCUS_946.40;1` exited 0.
- Both full files had size 1,886,208 bytes and SHA-1 `e173426c157384ebf1b6caf8c6fea18a85a14af9`.
- The tracked `Makefile` validates the ignored executable against its ignored manifest, invokes the ignored Splat configuration, assembles with local GNU Binutils, links, and converts to the ignored rebuilt binary. Its `clean` target removes only a non-symlink `build/` directory.
This is a byte-identical USA **payload-data assembly baseline**. It permits reproducible full-binary verification, but does not establish source sections, object boundaries, functions, linker layout, or original code generation.
### Tooling and synthetic evidence
- Pinned ignored Splat 0.50.0 successfully split a self-authored synthetic PS-X EXE; its auto-config heuristic failed for the intentionally tiny fixture, while a manually ordered synthetic configuration succeeded.
- Local GNU Binutils 2.46.0 was built from a SHA-256- and PGP-verified source recipe and extracted under ignored `tools/` without system installation. Its assembler accepted self-authored COP2 and Splat GTE-macro sources; LLVM's MIPS assembler did not.
- `tools/sf3_fingerprint_probe` compiled a fixed synthetic C fixture twice with Clang 22.1.8 and assembled with local GNU Binutils. The resulting candidate objects were byte-identical, ELF32 little-endian MIPS R3000 objects with `noreorder, mips1` flags and `R_MIPS_26`/`R_MIPS_32` relocations. The tool refuses output-directory reuse.
- The final synthetic-only suite passed all 28 tests.
## Deviations and Bounded Results
| Item | Plan | Actual | Reason / limit |
|---|---|---|---|
| Assembly segmentation | Reassemble evidence-backed assembly regions | Initial whole-payload and loader-block code splits decoded non-code bytes as unsupported instructions; final baseline uses one payload data segment | The exact baseline is valid, but it is not a code/function/source segmentation result. |
| Compiler fingerprint | Establish comparison-backed original compiler/assembler/linker constraints | Only modern Clang/GNU-as synthetic reproducibility was established | The payload-data baseline supplies no original C function/object comparator. The static PsyQ import value does not identify a compiler revision, flags, assembler, linker, or library set. |
| LLVM bootstrap path | Candidate MIPS assembler/linker path | LLVM assembled basic synthetic MIPS I but rejected required PSX COP2/GTE support | Local GNU Binutils supplied the required synthetic COP2/GTE capability; neither tool is identified as original. |
## Verification and Firewall
- `PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s tools/tests -v` passed all 28 synthetic-only tests.
- A final clean `make clean && make all`, exact `cmp`, and full-file SHA-1 check passed.
- `git diff --check` and the unstaged-index check passed before closure staging.
- Representative `disks/`, `extracted/`, `asm/`, `build/`, `expected/`, `ghidra/`, `dumps/`, `.run/`, and local-tool paths were confirmed ignored; generated/tool directories were confirmed non-symlink directories.
- No disc image, extracted content, generated assembly, build output, expected binary, Ghidra material, dump, proprietary SDK material, or local tool artifact is part of the tracked change set.
## Rules Added This Phase
None.
## Next
Phase 3 is closed. A future phase must begin in a fresh session with an approved task-by-task plan. It must preserve the payload-data baseline while treating code/function segmentation and the original compiler/assembler/linker fingerprint as unresolved. Do not claim C matching until a candidate has direct object/function evidence and the full-binary gate remains green.
## Plain-English Recap
Phase 3 built a clean, reproducible pipeline that rebuilds the validated USA executable byte-for-byte while keeping all game-derived material ignored. The match is achieved by faithfully emitting the full executable payload as assembler data, so it proves the pipeline and comparison gate—not recovered source code or the original compiler settings. A synthetic modern-tool probe is reproducible, but the original PsyQ compiler/assembler/linker remains unidentified.
## 🛑 Stop Here
`CURRENT_PHASE.md` is archived as `phase-ends/logs/Phase3.md`; this PhaseEnd and the digest update belong in the closure commit. Do not begin Phase 4 in this session.