feat(xexdb): lift the DuckDB generator and disassembler out of the retired emulator #32
Reference in New Issue
Block a user
Delete Branch "feat/xexdb-tool"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
CONSOLIDATION.md Phase 3 — the DuckDB generator and disassembler, lifted out of the retired emulator.
⚠️ Stacked: this branch contains #30 (reference assets —
build.rsneeds the export table) and #31 (container docs). Merge those first, or merge this and close them.What came, and what did not
≈17,200 lines of ~71,000. No interpreter, no JIT, no scheduler, no GPU, no kernel — possible because the coupling was three symbols:
decoder::decode,disasm::DisasmItem,disasm::format.🔴 The gate: regenerate the database and diff it
Schema is a superset — 22 new tables (RTTI, jump tables, XDBF, SQL views) and none lost.
instructions(1,865,751),pdata_entries,imports,sectionsand all threeeh_*identical to the row. Most others are slightly higher: +195 functions, +226 strings, +224 classes, from the "complete, correct and faster" work on that branch.Two tables drop by ~1.8 M, and it is not a loss:
I checked rather than assumed: the xref delta is entirely
ind_call(−1,823,098; everything else nets +1,512, mostly newjtrows). The new schema records why — 6,556 sitestruncated=truecarrying 1,801,075 candidates, against 427 untruncated sites producing the 4,199. Abcctrlthroughthis->vptrat offset 0 matches nearly every class, so the old database materialised a cross product. The count is now truthful and the rows are not invented.Two defects fixed during the move, not after
The export table came from a sibling checkout.
build.rsread Canary'sxboxkrnl_table.incthrough../xenia-canary/src/…; when absent it printed acargo:warning, returned an empty table, and every import in the database resolved to nothing while the build still succeeded. It now readsdocs/reference/xbox360-exports.jsonfrom this repo — 2,913 ordinals, the exact count #30 adopted, printed in the build log — and a missing file fails the build.zq.py's escape hatch pointed at a command that no longer exists (xenia-rs exec --dump-addr). Replaced with the two static routes: the.peis a flat VA dump (offset = VA − 0x82000000), andsylph-xexdb extractregenerates it byte-identically.Also corrected: the
--dbhelp said "SQLite" in two places. It is DuckDB.Lint
check 0 · clippy 0 · fmt 0. Four#![allow]s, each scoped and argued rather than blanket:lzx.rs— index arithmetic is the algorithm; a decompressor that is merely idiomatic is worth nothing if it is not bit-exact.sylpheed-xexdb— nine sites indexreg[r]whereris the PowerPC register number; plus argument counts and one return type on code that arrived whole from a retired repo, where a refactor would be an unreviewed edit dressed as a lint fix.identity_op, because<< 0keeps the encodings checkable by eye against the ISA field table, which is all a generator has.Everything else clippy asked for is fixed, including all 14 doc-indent sites.
Tests: the three that failed were mine, not a port defect —
disasm_goldens.rsresolves fixtures through a relative path and I had copied the test without the data. Fixtures moved, paths repointed. The full workspace test leg is running as I open this; I will comment with the number.⏳→✅ The outstanding workspace
cargo testcountCONSOLIDATION.mdlisted this as the one result never reported cleanly. Run 2026-09-15 on thesecond machine, head
6048829, insylph-ci:local(rustc 1.98.1 (48a229cea 2026-09-01),byte-identical to the runner's):
docker/ci/run cargo test --workspace --no-fail-fastThe +9 between them is exactly the nine unit tests #35 adds in
imports.rs(368 + 9 = 377).🔴 The one failure is not this PR's.
ui_prm_primitives_disc::the_derived_order_puts_primitives_last_and_that_wipes_screensfails on
mainitself since #23 — bisected: passes at4ca0b8eand641be93, fails at3977cc9, independent of corpus, branch and toolchain. #23 forces full-screen primitives first(
ui-forced-backdrop.md), so the wipe the test asserts still exists no longer happens. CI isgreen because the runner has no disc.
Three things that make the number reproducible, all learned by it failing first:
--no-fail-fastis required. Without itcargo teststops at the first failing binary —an earlier run reported "25 suites / 201 passed", which was about half the workspace.
SYLPH_CI_MEM_GB=7cannot finish on a 31 GB machine with the disc mounted.slb_leading_segment_discis SIGKILLed: six test threads each load a large voice bank.Serial passes 10/10 in 35 s under the same 7 GB, so it is concurrency, not one allocation.
The default is "half the machine" for a 15 GB box. This run used 14.
sylph-ci-targetvolume on a cold build. It pushed thishost to 95%; it has been deleted since.
CONSOLIDATION.md Phase 2. Each of these existed only in a repository about to be retired, or as an untracked file on one disk -- which, for anything that has to survive a machine, is the same as not existing. xex2-format.md 39 KB the XEX2 container format xbox360-exports.{json,md} 1.1 MB 2,913 exports: xboxkrnl, xam, xbdm ppc-instructions.{json,md} 340 KB the PowerPC instruction reference LICENSE MIT -- this repo had none The first two are byte-identical to xex2tractor's copies, verified with cmp, and byte-identical again to the loose untracked copies in the project root: three copies, zero of them tracked. docs/reference/ is deliberately its own directory with a README that says what it is NOT: nothing here is a finding, and no docs/re/ page should cite it as evidence. Reference material filed beside measurements is how a borrowed table starts getting read as a result. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>rustfmt, then clippy -D warnings across the three new crates. Mechanical, except three decisions that are stated rather than silently allowed: * lzx.rs gets file-scoped needless_range_loop/explicit_counter_loop allows. Index arithmetic IS the algorithm -- LZX is defined over symbol indices, Huffman slots and window positions, and a decompressor that is merely idiomatic is worth nothing if it is not bit-exact. * sylpheed-xexdb gets crate-scoped allows for needless_range_loop (nine sites index reg[r] where r is the PowerPC register number -- the index is the meaning), too_many_arguments and type_complexity. This code arrived whole from a retired repository; a refactor here would be an unreviewed edit dressed as a lint fix. * Everything else clippy asked for is FIXED, including all 14 doc-indent sites, the let-else, and a Prepared type alias in the binary. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>