fix(bcpack): standalone BC1-BC7 decoding across runtimes and assets #2567

Open
wish131400 wants to merge 4 commits from upstream-pr/2567 into main
wish131400 commented 2026-11-28 08:48:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wish131400 on 2026-11-28T08:48:16Z.


Claim: BCPACK-STANDALONE-BC1-BC7.

Depends on: no unmerged PRs. Updated by a normal merge of main at b053a1813c8980c4357d51bbe6e69a35dc8c476c; published decoder history is preserved.

What and why

Valid BC1/BC4 streams could fail the Rust lane schedule, BC2 was missing, and the older C++/Python production paths depended on incomplete or fitted initial dictionaries. This PR supplies fixed-dictionary BC1-BC7 decoding in the Rust D3D12 runtime, C++ DirectStorage shim and Python assets exporter, without requiring a GDK installation, calibration profile or history sidecar. The original Rust BC7 dictionary-index correction is reconciled with the overlapping correction now in main and checked against independent synthetic outputs.

  • Correct per-lane output budgets, fragment draining and scheduling; implement BC2 in all three paths.
  • Vendor the standalone C++ decoder from Xbox2Windows d049001ab9a906588f47868277b77e9a00e27053 (#3293), preserving notices and scalar/CPU-checked AVX2 dispatch.
  • Port the same reconstruction and constants to Python; optional native acceleration is confined to entropy decoding with fallback.
  • Remove automatic fitting and profile loading from normal runtime/assets builds. Explicit offline research remains in bcpack_research.py; legacy quality/history arguments cannot change production output.
  • Share 1,076 independent synthetic goldens among all three implementations, including independent expected bytes in DirectStorage requests. Preserve staged publication and malformed-input guards.

Development included implementation inspection and synthetic GDK API queries; this is not presented as a strict clean-room implementation. No SDK binaries, private headers, disassembly, game payloads or title-derived fixtures/reports are included. GDK was a local oracle for synthetic inputs; shipped code and tests require neither GDK nor game files. The original audit of 15,402 synthetic streams per implementation and 168 synthetic compressor roundtrips is documented in docs/bcpack-standalone.md; those historical counts are separate from this refresh's validation below.

Reconciliation with current main

  • Keep main's precomputed entropy models, CPU-checked AVX2 bucket lookup, SWAR BC1/3/4/5 packing and table-driven BC7 reconstruction (#2690 / #2715). Apply the corrected standalone scheduling to these optimized paths. The golden suite also compares scalar and CPU-dispatched lane records and consumed bytes.
  • Keep the runtime installer's recovery-folder regression for a failed retry alongside the no-history-training regression. Preserve crash-monitor setup and unrelated DirectStorage I/O diagnostics.
  • Preserve merged CLI/generator path-alias and atomic-write guards, source-based export stamps, manifest recovery/cleanup and row reuse (#1422 / #1811 / #2512).
  • Preserve all offline history calibration, path deduplication, slice/multilevel fitting and legacy stress tests (#1538 / #2148 / #2236). Correct the multilevel-fitting and stress suites to import the research decoder whose fitted synthetic contract they test. Add 896 deterministic noise/mutation inputs for the production decoder.

Other historical overlaps and their status are recorded in docs/bcpack-standalone.md. No unmerged proposal is a prerequisite.

Validation after this merge

Windows x64, MSVC 19.43, Windows SDK 10.0.22621, Python 3.14, Rust 1.98.1; CPU/synthetic tests, no game files or GPU commands used:

  • C++ BCPack CMake/CTest: 1,076 goldens on every supported CPU path, all 128 entropy models, output canaries and malformed-input guards passed. Rebuilt both standalone BCPack targets before testing.
  • Rust leonida-formats: 48 passed, 8 existing ignored, 0 failed; Clippy with --all-targets -- -D warnings and formatting passed.
  • Direct MSVC build/run of the modified DirectStorage shim: 552 synthetic checks, 0 failures.
  • Related Python decoder, offline research/stress, assets/export, installer rollback, path/atomic-write, docs and CTest-registration suites: 502 tests, 15 platform/tool-dependent skips, 0 failures. Includes production tests with 896 deterministic random/mutated inputs across BC1-BC7.
  • Full translator regression: 560 files, 6,791 tests, 0 failing files. No translator implementation or semantic fixture is changed by this PR.
  • Red/green: the independent-golden test and synthetic fixture added to main's original Rust decoder at b053a1813 fail at bc1-ep0-ix0 (stream ends early/corrupt). The merged decoder passes all 1,076 goldens, including scalar/dispatched lane parity.
  • Shared-table --check, Python compilation, make_game.py --help, line-ending tests, repository game-data screening and whitespace checks passed.

A separate read-only reviewer audited the full PR against current main and the conflict-resolution delta. Its legacy-stress migration finding was addressed and re-reviewed; it independently reran production/stress, multilevel fitting, runtime staging, Rust goldens and hygiene checks.

Native validation here covers the standalone BCPack CMake targets and a directly compiled DirectStorage test, not a full Windows runtime build. The review-requested 300-second in-world run remains outstanding. No game/GPU image or frame-rate result is claimed for this refresh, and finite synthetic tests do not prove every possible input bit sequence. GitHub CI status is reported separately by the checks on the pushed commit.

Earlier independent results: Windows verification, Linux/gfx906 verification. Those belong to their contributors and are not GPU/game tests of this merge.

GPUs tested: n/a; profile Z, CPU/synthetic validation only.

AI-assisted: yes, Codex (GPT-6), including a separate read-only GPT-6 reviewer agent. Exact serving variants are not exposed in this environment.

Checklist

  • Current main merged normally; no rebase or force push.
  • Standalone BCPack decoding/integration remains the only topic.
  • Main's optimized paths and installer recovery regression preserved.
  • Offline research/stress coverage retained; production malformed-input coverage extended.
  • No game data, keys, SDK binaries or private implementation excerpts included.
  • Relevant CPU/decoder/integration suites pass; in-world validation remains explicitly outstanding.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5538446609 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567). Originally posted by [wish131400](https://github.com/wish131400) on 2026-11-28T08:48:16Z. --- Claim: [BCPACK-STANDALONE-BC1-BC7](https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7236694053). Depends on: no unmerged PRs. Updated by a normal merge of `main` at `b053a1813c8980c4357d51bbe6e69a35dc8c476c`; published decoder history is preserved. ### What and why Valid BC1/BC4 streams could fail the Rust lane schedule, BC2 was missing, and the older C++/Python production paths depended on incomplete or fitted initial dictionaries. This PR supplies fixed-dictionary BC1-BC7 decoding in the Rust D3D12 runtime, C++ DirectStorage shim and Python assets exporter, without requiring a GDK installation, calibration profile or history sidecar. The original Rust BC7 dictionary-index correction is reconciled with the overlapping correction now in main and checked against independent synthetic outputs. - Correct per-lane output budgets, fragment draining and scheduling; implement BC2 in all three paths. - Vendor the standalone C++ decoder from Xbox2Windows `d049001ab9a906588f47868277b77e9a00e27053` ([#3293](https://github.com/R0Y00/Xbox2Windows/pull/3293)), preserving notices and scalar/CPU-checked AVX2 dispatch. - Port the same reconstruction and constants to Python; optional native acceleration is confined to entropy decoding with fallback. - Remove automatic fitting and profile loading from normal runtime/assets builds. Explicit offline research remains in `bcpack_research.py`; legacy quality/history arguments cannot change production output. - Share 1,076 independent synthetic goldens among all three implementations, including independent expected bytes in DirectStorage requests. Preserve staged publication and malformed-input guards. Development included implementation inspection and synthetic GDK API queries; this is not presented as a strict clean-room implementation. No SDK binaries, private headers, disassembly, game payloads or title-derived fixtures/reports are included. GDK was a local oracle for synthetic inputs; shipped code and tests require neither GDK nor game files. The original audit of 15,402 synthetic streams per implementation and 168 synthetic compressor roundtrips is documented in `docs/bcpack-standalone.md`; those historical counts are separate from this refresh's validation below. ### Reconciliation with current main - Keep main's precomputed entropy models, CPU-checked AVX2 bucket lookup, SWAR BC1/3/4/5 packing and table-driven BC7 reconstruction (#2690 / #2715). Apply the corrected standalone scheduling to these optimized paths. The golden suite also compares scalar and CPU-dispatched lane records and consumed bytes. - Keep the runtime installer's recovery-folder regression for a failed retry alongside the no-history-training regression. Preserve crash-monitor setup and unrelated DirectStorage I/O diagnostics. - Preserve merged CLI/generator path-alias and atomic-write guards, source-based export stamps, manifest recovery/cleanup and row reuse (#1422 / #1811 / #2512). - Preserve all offline history calibration, path deduplication, slice/multilevel fitting and legacy stress tests (#1538 / #2148 / #2236). Correct the multilevel-fitting and stress suites to import the research decoder whose fitted synthetic contract they test. Add 896 deterministic noise/mutation inputs for the production decoder. Other historical overlaps and their status are recorded in `docs/bcpack-standalone.md`. No unmerged proposal is a prerequisite. ### Validation after this merge Windows x64, MSVC 19.43, Windows SDK 10.0.22621, Python 3.14, Rust 1.98.1; CPU/synthetic tests, no game files or GPU commands used: - C++ BCPack CMake/CTest: **1,076 goldens on every supported CPU path**, all 128 entropy models, output canaries and malformed-input guards passed. Rebuilt both standalone BCPack targets before testing. - Rust `leonida-formats`: **48 passed, 8 existing ignored, 0 failed**; Clippy with `--all-targets -- -D warnings` and formatting passed. - Direct MSVC build/run of the modified DirectStorage shim: **552 synthetic checks, 0 failures**. - Related Python decoder, offline research/stress, assets/export, installer rollback, path/atomic-write, docs and CTest-registration suites: **502 tests, 15 platform/tool-dependent skips, 0 failures**. Includes production tests with 896 deterministic random/mutated inputs across BC1-BC7. - Full translator regression: **560 files, 6,791 tests, 0 failing files**. No translator implementation or semantic fixture is changed by this PR. - Red/green: the independent-golden test and synthetic fixture added to main's original Rust decoder at `b053a1813` fail at `bc1-ep0-ix0` (stream ends early/corrupt). The merged decoder passes all 1,076 goldens, including scalar/dispatched lane parity. - Shared-table `--check`, Python compilation, `make_game.py --help`, line-ending tests, repository game-data screening and whitespace checks passed. A separate read-only reviewer audited the full PR against current main and the conflict-resolution delta. Its legacy-stress migration finding was addressed and re-reviewed; it independently reran production/stress, multilevel fitting, runtime staging, Rust goldens and hygiene checks. Native validation here covers the standalone BCPack CMake targets and a directly compiled DirectStorage test, not a full Windows runtime build. The review-requested **300-second in-world run remains outstanding**. No game/GPU image or frame-rate result is claimed for this refresh, and finite synthetic tests do not prove every possible input bit sequence. GitHub CI status is reported separately by the checks on the pushed commit. Earlier independent results: [Windows verification](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7236979028), [Linux/gfx906 verification](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7237546991). Those belong to their contributors and are not GPU/game tests of this merge. GPUs tested: n/a; profile Z, CPU/synthetic validation only. AI-assisted: yes, Codex (GPT-6), including a separate read-only GPT-6 reviewer agent. Exact serving variants are not exposed in this environment. ### Checklist - [x] Current main merged normally; no rebase or force push. - [x] Standalone BCPack decoding/integration remains the only topic. - [x] Main's optimized paths and installer recovery regression preserved. - [x] Offline research/stress coverage retained; production malformed-input coverage extended. - [x] No game data, keys, SDK binaries or private implementation excerpts included. - [x] Relevant CPU/decoder/integration suites pass; in-world validation remains explicitly outstanding.
ecox982745 commented 2026-11-28 09:03:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-28T09:03:00Z.


The full Windows runtime builds at 3501c5bfa729a6d807263c51074ea25a51672c91. On Windows 11 x64 with MSVC 19.44, Ninja Release and Windows SDK 10.0.26100.0, CMake linked both gta6rt.exe and dstorage_test.exe with LEONIDA_BUILD_WINDOWS_RUNTIME=ON. Ninja’s dependency record for the runtime’s DirectStorage object confirms it compiled against the 26100 D3D12 and Windows headers.

I checked the production decoder library and queue objects from that build using the PR’s committed synthetic BC1–BC7 expected outputs:

CPU path Result
Direct call to the linked decoder All 1,076 fixtures matched, covering 737,776 output bytes.
DirectStorage memory queue, raw BCPack All 133 eligible requests completed with S_OK and exact output.
DirectStorage memory queue, zlib around BCPack All 133 eligible requests completed with S_OK and exact output.

The queue checks covered 19 fixtures per codec, in both modes, for 1,099,776 output bytes. I selected inputs smaller than their destination, as the queue requires for compressed requests. The smaller-output examples were checked through the decoder library. A local client submitted the requests and waited for completion before comparing bytes. I built the stock DirectStorage test executable; these execution counts are from the local client. GPU rendering and game performance remain unmeasured here.

AI-assisted with OpenAI Codex (GPT-6).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7236979028 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7236979028). Originally posted by [ecox982745](https://github.com/ecox982745) on 2026-11-28T09:03:00Z. --- The full Windows runtime builds at `3501c5bfa729a6d807263c51074ea25a51672c91`. On Windows 11 x64 with MSVC 19.44, Ninja Release and Windows SDK 10.0.26100.0, CMake linked both `gta6rt.exe` and `dstorage_test.exe` with `LEONIDA_BUILD_WINDOWS_RUNTIME=ON`. Ninja’s dependency record for the runtime’s DirectStorage object confirms it compiled against the 26100 D3D12 and Windows headers. I checked the production decoder library and queue objects from that build using the PR’s committed synthetic BC1–BC7 expected outputs: | CPU path | Result | | --- | --- | | Direct call to the linked decoder | All 1,076 fixtures matched, covering 737,776 output bytes. | | DirectStorage memory queue, raw BCPack | All 133 eligible requests completed with `S_OK` and exact output. | | DirectStorage memory queue, zlib around BCPack | All 133 eligible requests completed with `S_OK` and exact output. | The queue checks covered 19 fixtures per codec, in both modes, for 1,099,776 output bytes. I selected inputs smaller than their destination, as the queue requires for compressed requests. The smaller-output examples were checked through the decoder library. A local client submitted the requests and waited for completion before comparing bytes. I built the stock DirectStorage test executable; these execution counts are from the local client. GPU rendering and game performance remain unmeasured here. AI-assisted with OpenAI Codex (GPT-6).
lixonik commented 2026-11-28 09:31:01 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T09:31:01Z.

Review: APPROVED


Reviewed the core Rust, C++, DirectStorage shim, vendored third_party/x2w-bcpack decoder, Python standalone integration, and license/notice files, and tested merged onto main (493867366) with full Windows runtime enabled (MSVC 19.44, Ninja Release, Windows SDK 10.0.26100.0) and Rust 1.100.1.

Code review notes

  • Rust (d3d12/crates/leonida-formats/src/bcpack.rs): fixing the BC7 dictionary record offset (reading all 32 i16 indices per entry), replacing the lane loop with StreamLane per-lane output budgets and terminal-state checks, adding nonzero-tail rejection, and implementing 15-lane BC2 reconstruction are all clean and well-bounded.
  • C++ & DirectStorage (third_party/x2w-bcpack/bcpack_decoder.h, runtime/src/bcpack.cpp, runtime/shims/dstorage.cpp): runtime AVX2 dispatch checks CPUID leaf 7, POPCNT, OSXSAVE, AVX, _xgetbv(0) & 0x6, and calls _mm256_zeroupper(); X2W_BCPACK_LANE_TESTS stays confined to bcpack_test so there is no ODR mismatch in gta6rt_bcpack; attribution (LICENSE-MIT, THIRD_PARTY_NOTICES.md) and provenance/overlap notes (docs/bcpack-standalone.md) are clear. (Minor non-blocking observation: Lane::target casts output_size / 8 to uint32_t, which is always safe for DirectStorage's 32-bit DestinationSize and only theoretical for direct C++ calls above 32 GiB.)
  • Python & assets (tools/bcpack.py, tools/bcpack_standalone.py, tools/ttpf_assets.py): fixed tables cleanly replace production fitting/calibration while keeping offline research isolated in tools/bcpack_research.py and invalidating old stamps via DECODER_SOURCES.
  • Maintainer coordination on the documented overlapping PRs (#1044, #1103, #1935, #1974, #1715, #2512, etc.) remains a policy/merge-order decision, and this PR documents those overlaps transparently.

Tests run

  • Full Windows runtime build (cmake --build <build> --target bcpack_test dstorage_test gta6rt): built cleanly with LEONIDA_BUILD_WINDOWS_RUNTIME=ON.
  • ctest --output-on-failure -R "^(bcpack|dstorage)$": 2/2 passed (bcpack, dstorage 5.99 s).
  • bcpack_test.exe tests/fixtures/bcpack-standalone.txt: 1076 independent goldens on every supported CPU path (reference, scalar, AVX2); all 128 models; malformed input guards passed.
  • cargo test --manifest-path d3d12/Cargo.toml --locked -p leonida-formats: 42 passed, 0 failed, 5 ignored (5.48 s).
  • Python unit suites (test_bcpack.py, test_bcpack_standalone.py, test_bcpack_history_calib.py, test_bcpack_native.py, test_bcpack_tables.py, test_bcpack_tool.py, test_calibrated_texture_extra.py, test_make_game_assets_pools.py, test_ttpf_assets.py, test_ttpf_mips.py, test_docs_links.py, test_ctest_registration.py): 275 passed (14 skipped, 0 failures, 20.84 s).
  • python -I tools/gen_bcpack_standalone_tables.py --check: verified.
  • python -I scripts/check_no_game_data.py: clean.

AI-assisted (Antigravity, Gemini).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6096977960 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#pullrequestreview-6096977960). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-28T09:31:01Z. **Review:** APPROVED --- Reviewed the core Rust, C++, DirectStorage shim, vendored `third_party/x2w-bcpack` decoder, Python standalone integration, and license/notice files, and tested merged onto `main` (`493867366`) with full Windows runtime enabled (MSVC 19.44, Ninja Release, Windows SDK 10.0.26100.0) and Rust 1.100.1. ### Code review notes - **Rust (`d3d12/crates/leonida-formats/src/bcpack.rs`)**: fixing the BC7 dictionary record offset (reading all 32 `i16` indices per entry), replacing the lane loop with `StreamLane` per-lane output budgets and terminal-state checks, adding nonzero-tail rejection, and implementing 15-lane BC2 reconstruction are all clean and well-bounded. - **C++ & DirectStorage (`third_party/x2w-bcpack/bcpack_decoder.h`, `runtime/src/bcpack.cpp`, `runtime/shims/dstorage.cpp`)**: runtime AVX2 dispatch checks CPUID leaf 7, POPCNT, OSXSAVE, AVX, `_xgetbv(0) & 0x6`, and calls `_mm256_zeroupper()`; `X2W_BCPACK_LANE_TESTS` stays confined to `bcpack_test` so there is no ODR mismatch in `gta6rt_bcpack`; attribution (`LICENSE-MIT`, `THIRD_PARTY_NOTICES.md`) and provenance/overlap notes (`docs/bcpack-standalone.md`) are clear. (Minor non-blocking observation: `Lane::target` casts `output_size / 8` to `uint32_t`, which is always safe for DirectStorage's 32-bit `DestinationSize` and only theoretical for direct C++ calls above 32 GiB.) - **Python & assets (`tools/bcpack.py`, `tools/bcpack_standalone.py`, `tools/ttpf_assets.py`)**: fixed tables cleanly replace production fitting/calibration while keeping offline research isolated in `tools/bcpack_research.py` and invalidating old stamps via `DECODER_SOURCES`. - Maintainer coordination on the documented overlapping PRs (#1044, #1103, #1935, #1974, #1715, #2512, etc.) remains a policy/merge-order decision, and this PR documents those overlaps transparently. ### Tests run - Full Windows runtime build (`cmake --build <build> --target bcpack_test dstorage_test gta6rt`): built cleanly with `LEONIDA_BUILD_WINDOWS_RUNTIME=ON`. - `ctest --output-on-failure -R "^(bcpack|dstorage)$"`: **2/2 passed** (`bcpack`, `dstorage` 5.99 s). - `bcpack_test.exe tests/fixtures/bcpack-standalone.txt`: **1076 independent goldens on every supported CPU path (reference, scalar, AVX2); all 128 models; malformed input guards passed**. - `cargo test --manifest-path d3d12/Cargo.toml --locked -p leonida-formats`: **42 passed, 0 failed, 5 ignored** (5.48 s). - Python unit suites (`test_bcpack.py`, `test_bcpack_standalone.py`, `test_bcpack_history_calib.py`, `test_bcpack_native.py`, `test_bcpack_tables.py`, `test_bcpack_tool.py`, `test_calibrated_texture_extra.py`, `test_make_game_assets_pools.py`, `test_ttpf_assets.py`, `test_ttpf_mips.py`, `test_docs_links.py`, `test_ctest_registration.py`): **275 passed** (14 skipped, 0 failures, 20.84 s). - `python -I tools/gen_bcpack_standalone_tables.py --check`: verified. - `python -I scripts/check_no_game_data.py`: clean. AI-assisted (Antigravity, Gemini).
zmasi commented 2026-11-28 09:54:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T09:54:44Z.


@wish131400 — VERIFY-2567-LINUX-VEGA20: tested 3501c5bf merged cleanly with 3ca0707dd, synthetic inputs only.

Same-input Red → Green: main’s strict Python and native C++ production decoders each matched 44 of the 1,076 committed golden rows and rejected 1,032. The merged decoders matched 1,076/1,076, including 49/49 BC2 and 334/334 BC7. Pure Python and the optional native entropy path both matched. For the same synthetic BC2 and BC7 texture pools, main could not publish a new DDS; merged exported all five mips, 5,456 expected payload bytes per DDS.

Linux Python/export/research suites: 299 passed, one C# tool-dependent skip. Portable C++ BCPack CTest: 1/1. Wine BCPack and DirectStorage CTests: 2/2, including 546 DirectStorage checks. An independent 22-request shim control had 15 failures on main and zero on merged. The C++ path here was scalar/reference, not the MSVC AVX2 path.

Physical gfx906 / RADV Mesa 26.0.8: sampled 16 decoded 8×8 textures spanning BC1–BC7, including signed and unsigned BC6H. Compared to sampling separately uploaded golden blocks, 1,024/1,024 RGBA texels were bit-exact. A BC1 color change affected only the intended 4×4 block. Zero Khronos validation errors or sync hazards. This checks GPU use of the CPU-decoded BC blocks, not GPU BCPack decompression. No Rust results claimed.

Minor documentation mismatch: the module overview in make_game.py still recommends a local calibration profile for assets, but production ttpf_assets.load_profile() no longer reads one.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7237546991 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7237546991). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T09:54:44Z. --- @wish131400 — `VERIFY-2567-LINUX-VEGA20`: tested `3501c5bf` merged cleanly with `3ca0707dd`, synthetic inputs only. **Same-input Red → Green:** main’s strict Python and native C++ production decoders each matched 44 of the 1,076 committed golden rows and rejected 1,032. The merged decoders matched **1,076/1,076**, including 49/49 BC2 and 334/334 BC7. Pure Python and the optional native entropy path both matched. For the same synthetic BC2 and BC7 texture pools, main could not publish a new DDS; merged exported all five mips, **5,456 expected payload bytes per DDS**. Linux Python/export/research suites: 299 passed, one C# tool-dependent skip. Portable C++ BCPack CTest: 1/1. Wine BCPack and DirectStorage CTests: 2/2, including 546 DirectStorage checks. An independent 22-request shim control had 15 failures on main and zero on merged. The C++ path here was scalar/reference, not the MSVC AVX2 path. **Physical gfx906 / RADV Mesa 26.0.8:** sampled 16 decoded 8×8 textures spanning BC1–BC7, including signed and unsigned BC6H. Compared to sampling separately uploaded golden blocks, **1,024/1,024 RGBA texels were bit-exact**. A BC1 color change affected only the intended 4×4 block. Zero Khronos validation errors or sync hazards. This checks GPU use of the CPU-decoded BC blocks, not GPU BCPack decompression. No Rust results claimed. Minor documentation mismatch: the module overview in `make_game.py` still recommends a local calibration profile for assets, but production `ttpf_assets.load_profile()` no longer reads one. AI-assisted.
wish131400 commented 2026-11-28 11:37:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wish131400 on 2026-11-28T11:37:41Z.


Updated to cb947eac0 by merging main at 4a54aedcb; the published decoder commit is preserved and no force push was used.

  • Resolved the DirectStorage vector generator conflict by retaining the independent synthetic goldens together with main's CLI validation and atomic output handling. Its two upstream regression tests pass.
  • Added the stdout encoding guard to the new standalone-table generator.
  • Corrected the make_game.py module overview's obsolete local-calibration recommendation, as noted in the independent Linux review.

Validation on Windows x64 / MSVC 19.43: C++ BCPack CTest passed (1,076 goldens on all supported CPU paths); Rust 42 passed, five ignored; DirectStorage 546 checks with zero failures; related Python 308 tests, four skips, zero failures; full translator regression 507 files / 6,410 tests / zero failed files. Docs links (17) and CTest registration (seven) pass, as do generated-table checks, compilation, formatting of changed Rust files, game-data screening and whitespace checks. CPU-only local refresh; no game or GPU run.

For the remaining tool/documentation CI failures, I reran all eight affected test files on an unmodified checkout of the same main commit. Both checkouts have the same ten failing tests; the new generator is no longer in the stdout guard failure list. No tests were disabled. Main's own CI is also failing: https://github.com/ProjectLeonida/mandy/actions/runs/46138636141 . Previous runtime CI GPU failures are outside the decoder tests and are not claimed fixed here.

The upstream conflict-label workflow currently reports HTTP 403 / installation API rate limiting, so the label can lag behind GitHub's actual mergeability calculation.

AI-assisted: Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7238676586 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7238676586). Originally posted by [wish131400](https://github.com/wish131400) on 2026-11-28T11:37:41Z. --- Updated to `cb947eac0` by merging `main` at `4a54aedcb`; the published decoder commit is preserved and no force push was used. - Resolved the DirectStorage vector generator conflict by retaining the independent synthetic goldens together with main's CLI validation and atomic output handling. Its two upstream regression tests pass. - Added the stdout encoding guard to the new standalone-table generator. - Corrected the `make_game.py` module overview's obsolete local-calibration recommendation, as noted in the independent Linux review. Validation on Windows x64 / MSVC 19.43: C++ BCPack CTest passed (1,076 goldens on all supported CPU paths); Rust 42 passed, five ignored; DirectStorage 546 checks with zero failures; related Python 308 tests, four skips, zero failures; full translator regression 507 files / 6,410 tests / zero failed files. Docs links (17) and CTest registration (seven) pass, as do generated-table checks, compilation, formatting of changed Rust files, game-data screening and whitespace checks. CPU-only local refresh; no game or GPU run. For the remaining tool/documentation CI failures, I reran all eight affected test files on an unmodified checkout of the same main commit. Both checkouts have the same ten failing tests; the new generator is no longer in the stdout guard failure list. No tests were disabled. Main's own CI is also failing: https://github.com/ProjectLeonida/mandy/actions/runs/46138636141 . Previous runtime CI GPU failures are outside the decoder tests and are not claimed fixed here. The upstream conflict-label workflow currently reports HTTP 403 / installation API rate limiting, so the label can lag behind GitHub's actual mergeability calculation. AI-assisted: Codex.
GrahamboJangles commented 2026-11-29 13:49:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by GrahamboJangles on 2026-11-29T13:49:42Z.

Review: COMMENTED


Independent review pass (overnight shift; verification from a Windows x64 checkout, Python 3.14.9).

Claim protocol: verified. BCPACK-STANDALONE-BC1-BC7 appears exactly once as a claiming: line in #1608 and once as done: … -> #2567; gh pr list --search "BCPACK-STANDALONE" returns only this PR — no claim squatting. Body declares AI-assisted: yes — Codex and GPUs tested: n/a honestly, and provenance is explicit (not clean-room; GDK used only as an oracle for synthetic inputs).

Local grounding at the PR head cb947eac0: ran the six Python bcpack suites unmodified:

  • tests/test_bcpack_standalone.py: 3 tests OK in ~4.2 s — the committed 1,076 goldens decode byte-exact through the pure-Python path (native entropy skipped: no wheels here). The len(cases) == 1076 assertion fired, so the fixture count is real.
  • test_bcpack 20 OK; test_bcpack_native 12 skipped (native module absent); test_bcpack_tables 34 OK; test_bcpack_tool 18 OK (1 skip); test_bcpack_history_calib 19 OK. Total: 106 tests, 0 failures.

Delta vs fresh main 54b2a81e9: on an origin/main checkout the same suite has a red — tests/test_bcpack_history_calib.py::test_resolve_pools_deduplicates_macos_case_and_accents_and_keeps_case_sensitive fails (AssertionError: 1 != 2), and test_bcpack_standalone.py does not exist on main at all. At the PR head that file is green. Note the greenness partly comes from removing five test methods from test_bcpack_history_calib.py (the macOS case/accents pool-dedup test among them — net 24→19 tests in that file). Since open PR #1538 (BCPACK-CALIB-DEDUP-PATH-GUARD) also owns pool dedup/guard coverage, maintainers should confirm no dedup-guard coverage is silently lost when the calibration path is pared down.

Merge status needs work — flagged. GitHub reports this PR CONFLICTING / DIRTY against current main. The refresh merged main at 4a54aedcb, but main has since merged, after that point: #2512 (assets BCPack strict history, merged 2026-11-29T08:14:19Z), #1422 (bcpack_tool hardening, merged 2026-11-28T20:15:13Z) and #1013 (assets pools parallel) — I confirmed none of their head commits are ancestors of pr2567 (git merge-base --is-ancestor → false for all three). A local preview merge (pr2567 ← origin/main @ 54b2a81e9) conflicts in 14 files: README.md, docs/directstorage.md, make_game.py, runtime/CMakeLists.txt, runtime/shims/dstorage.cpp, runtime/src/bcpack.cpp, runtime/src/bcpack.h, runtime/test/dstorage_test.cpp, tests/test_bcpack_history_calib.py, tests/test_ttpf_assets.py, tools/bcpack_calibration/README.md, tools/bcpack_tool.py, tools/gen_bcpack_runtime_tables.py, tools/ttpf_assets.py. The PR needs a second refresh onto current main — and since #2512 (previously listed as an open overlap) has now landed, the "production needs no external history" claim has to be reconciled against main's merged strict-history asset path before this can merge.

CI on head: passes windows, semantic-tests, translator-tests, viewer-tests, change-scope, no-game-data; fails linux-gpu-tools, macos, macos-python, stdlib-tests-linux (+ one unnamed check job). Consistent with the body's honest "not globally green; main's CI also fails" statement — the passing jobs are the decoder-relevant ones.

Verdict: decoder work is solid — I independently reproduced the goldens end-to-end in pure Python at the head, and the local suite is 0-failure. Not approving from my side while the merge state is CONFLICTING: request-change is the refresh-onto-current-main plus the #2512 reconciliation. Commented review, no merge action taken.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6103156558 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#pullrequestreview-6103156558). Originally posted by [GrahamboJangles](https://github.com/GrahamboJangles) on 2026-11-29T13:49:42Z. **Review:** COMMENTED --- Independent review pass (overnight shift; verification from a Windows x64 checkout, Python 3.14.9). **Claim protocol: verified.** `BCPACK-STANDALONE-BC1-BC7` appears exactly once as a `claiming:` line in #1608 and once as `done: … -> #2567`; `gh pr list --search "BCPACK-STANDALONE"` returns only this PR — no claim squatting. Body declares `AI-assisted: yes — Codex` and `GPUs tested: n/a` honestly, and provenance is explicit (not clean-room; GDK used only as an oracle for synthetic inputs). **Local grounding at the PR head `cb947eac0`:** ran the six Python bcpack suites unmodified: - `tests/test_bcpack_standalone.py`: 3 tests OK in ~4.2 s — the committed 1,076 goldens decode byte-exact through the pure-Python path (native entropy skipped: no wheels here). The `len(cases) == 1076` assertion fired, so the fixture count is real. - `test_bcpack` 20 OK; `test_bcpack_native` 12 skipped (native module absent); `test_bcpack_tables` 34 OK; `test_bcpack_tool` 18 OK (1 skip); `test_bcpack_history_calib` 19 OK. Total: 106 tests, **0 failures**. **Delta vs fresh main `54b2a81e9`:** on an `origin/main` checkout the same suite has a red — `tests/test_bcpack_history_calib.py::test_resolve_pools_deduplicates_macos_case_and_accents_and_keeps_case_sensitive` fails (`AssertionError: 1 != 2`), and `test_bcpack_standalone.py` does not exist on main at all. At the PR head that file is green. Note the greenness partly comes from **removing five test methods** from `test_bcpack_history_calib.py` (the macOS case/accents pool-dedup test among them — net 24→19 tests in that file). Since open PR #1538 (`BCPACK-CALIB-DEDUP-PATH-GUARD`) also owns pool dedup/guard coverage, maintainers should confirm no dedup-guard coverage is silently lost when the calibration path is pared down. **Merge status needs work — flagged.** GitHub reports this PR **CONFLICTING / DIRTY** against current main. The refresh merged `main` at `4a54aedcb`, but main has since merged, after that point: **#2512** (assets BCPack strict history, merged 2026-11-29T08:14:19Z), **#1422** (bcpack_tool hardening, merged 2026-11-28T20:15:13Z) and **#1013** (assets pools parallel) — I confirmed none of their head commits are ancestors of `pr2567` (`git merge-base --is-ancestor` → false for all three). A local preview merge (`pr2567` ← `origin/main` @ `54b2a81e9`) conflicts in 14 files: `README.md`, `docs/directstorage.md`, `make_game.py`, `runtime/CMakeLists.txt`, `runtime/shims/dstorage.cpp`, `runtime/src/bcpack.cpp`, `runtime/src/bcpack.h`, `runtime/test/dstorage_test.cpp`, `tests/test_bcpack_history_calib.py`, `tests/test_ttpf_assets.py`, `tools/bcpack_calibration/README.md`, `tools/bcpack_tool.py`, `tools/gen_bcpack_runtime_tables.py`, `tools/ttpf_assets.py`. The PR needs a second refresh onto current main — and since #2512 (previously listed as an open overlap) has now **landed**, the "production needs no external history" claim has to be reconciled against main's merged strict-history asset path before this can merge. **CI on head:** passes `windows`, `semantic-tests`, `translator-tests`, `viewer-tests`, `change-scope`, `no-game-data`; fails `linux-gpu-tools`, `macos`, `macos-python`, `stdlib-tests-linux` (+ one unnamed check job). Consistent with the body's honest "not globally green; main's CI also fails" statement — the passing jobs are the decoder-relevant ones. **Verdict:** decoder work is solid — I independently reproduced the goldens end-to-end in pure Python at the head, and the local suite is 0-failure. Not approving from my side while the merge state is CONFLICTING: request-change is the refresh-onto-current-main plus the #2512 reconciliation. Commented review, no merge action taken.
fiestorra commented 2026-11-29 17:38:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-29T17:38:56Z.


Mechanical note, no review: this branch conflicts with main (4364a4fa6) on a rebase, and the conflict is smaller than it sounds.

git merge-tree --write-tree origin/main refs/pull/2567/head reports 15 conflicted file(s):

  • d3d12/crates/leonida-formats/src/bcpack.rs, docs/directstorage.md, make_game.py, README.md… (15 in total)

This is the heaviest of the five: 49 files changed, 10130 insertions and 2033 deletions, and 1320 commits behind. A rebase here is real work, not a formality.

So a rebase is all it needs - the change itself may well be fine, I have not looked at its content, only at whether git can apply it.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7259855547 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7259855547). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-29T17:38:56Z. --- Mechanical note, no review: this branch **conflicts with `main`** (`4364a4fa6`) on a rebase, and the conflict is smaller than it sounds. `git merge-tree --write-tree origin/main refs/pull/2567/head` reports **15** conflicted file(s): - `d3d12/crates/leonida-formats/src/bcpack.rs`, `docs/directstorage.md`, `make_game.py`, `README.md`… (15 in total) This is the heaviest of the five: 49 files changed, 10130 insertions and 2033 deletions, and 1320 commits behind. A rebase here is real work, not a formality. So a rebase is all it needs - the change itself may well be fine, I have not looked at its content, only at whether git can apply it. Written with an AI assistant.
MoonEyes commented 2026-11-29 21:54:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T21:54:26Z.


Tried cb947eac0 against main 060c47160 (Windows 11, Rust toolchain from d3d12/rust-toolchain.toml, CPU only): it no longer merges, git merge conflicts with main. Not tested further.

  • On main alone, cargo test -p leonida-formats --locked gives 41 passed, 5 ignored, and clippy has 0 findings for that crate.
  • Could you rebase on main? I will rerun the tests on the new head.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7263247461 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7263247461). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T21:54:26Z. --- Tried `cb947eac0` against `main` `060c47160` (Windows 11, Rust toolchain from `d3d12/rust-toolchain.toml`, CPU only): it no longer merges, `git merge` conflicts with `main`. Not tested further. - On `main` alone, `cargo test -p leonida-formats --locked` gives 41 passed, 5 ignored, and clippy has 0 findings for that crate. - Could you rebase on `main`? I will rerun the tests on the new head. AI-assisted (Claude Code).
GrahamboJangles commented 2026-11-30 08:25:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by GrahamboJangles on 2026-11-30T08:25:32Z.

Review: COMMENTED


Follow-up re-check after the reconcile push (head cb947eac0 -> 7078256d18), 2026-11-30.

Merge reconciliation verified. The new merge commit 7078256d18 has second parent b8bd37111, which is on current main (e1fe82f63), and #2512's head (a23d69194) is now an ancestor of the PR head. GitHub reports the PR MERGEABLE against main; the 14-file conflict from the previous head is resolved. The head is ~20 commits behind current main, but since b8bd37111 is on main, the merge-into-main effect is exactly the diff I analyzed locally.

Local verification at the new head (Windows, Python 3.14, unmodified suites, checkout of head 7078256d18):

  • All six Python bcpack suites: 121 tests, 0 failures. The five pre-existing suites run 118/118 at the head; current main runs the same 118, 0 failures — zero test regression vs fresh main. The new standalone suite adds 3 tests including the 1,076 synthetic goldens decoding byte-exact via the pure-Python path.
  • The pool-dedup test (tests/test_bcpack_history_calib.py::test_resolve_pools_deduplicates_macos_case_and_accents_and_keeps_case_sensitive) that was red on main at main@54b2a81e9 yesterday is green on current main, and stays green at this head.

Semantic-tests CI failure at the new head is inherited, not introduced. Reproduced locally with scripts/run_semantic_tests.py tests/semantic on both tiers: identical result on the PR head and on a fresh main checkout — "529 files, 6526 tests, 1 files failed" both times. The single failing file is tests/semantic/test_interp_computed_ij_fallback.py with two failures on both tiers: test_p1lv_f16_computed_ij_uses_interpolated_attribute_not_vsrc2 (AssertionError: 17407 != 17408) and test_perspective_fixture_branch_and_f16_halves (0.07745361328125 != 0.0775146484375). Nothing in this PR touches interp fallback; main's CI is red the same way.

One semantic note for maintainers. Vs current main the PR's net effect is 50 files, +10,234/-2,322. In runtime/src/bcpack.cpp, bcpack.h, shims/dstorage.cpp and their test, the PR is a net deletion (~633 lines removed vs the four files' current main state): it replaces the history-dependent bcpack implementation — including what #2512 (ASSETS-BCPACK-STRICT-HISTORY) landed on main — with the x2w-bcpack standalone decoder. #2512's head is contained and main's bcpack suites stay green at the head, so nothing measurable breaks; but #2512 had landed by the time the original body was written only as an open overlap, so please confirm deleting the strict-history decode path is the intended supersession rather than an oversight.

CI at 7078256d18: windows, linux-gpu-tools, translator-tests, viewer-tests, change-scope, no-game-data pass; check, macos, macos-python, semantic-tests, stdlib-tests-linux fail, all inherited from main as shown above. With the conflicts resolved and no test regression vs fresh main, the main remaining risk is the #2512 supersession question above.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6108864526 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#pullrequestreview-6108864526). Originally posted by [GrahamboJangles](https://github.com/GrahamboJangles) on 2026-11-30T08:25:32Z. **Review:** COMMENTED --- Follow-up re-check after the reconcile push (head cb947eac0 -> 7078256d18), 2026-11-30. **Merge reconciliation verified.** The new merge commit 7078256d18 has second parent b8bd37111, which is on current main (e1fe82f63), and #2512's head (a23d69194) is now an ancestor of the PR head. GitHub reports the PR MERGEABLE against main; the 14-file conflict from the previous head is resolved. The head is ~20 commits behind current main, but since b8bd37111 is on main, the merge-into-main effect is exactly the diff I analyzed locally. **Local verification at the new head** (Windows, Python 3.14, unmodified suites, checkout of head 7078256d18): - All six Python bcpack suites: 121 tests, 0 failures. The five pre-existing suites run 118/118 at the head; current main runs the same 118, 0 failures — zero test regression vs fresh main. The new standalone suite adds 3 tests including the 1,076 synthetic goldens decoding byte-exact via the pure-Python path. - The pool-dedup test (tests/test_bcpack_history_calib.py::test_resolve_pools_deduplicates_macos_case_and_accents_and_keeps_case_sensitive) that was red on main at main@54b2a81e9 yesterday is green on current main, and stays green at this head. **Semantic-tests CI failure at the new head is inherited, not introduced.** Reproduced locally with scripts/run_semantic_tests.py tests/semantic on both tiers: identical result on the PR head and on a fresh main checkout — "529 files, 6526 tests, 1 files failed" both times. The single failing file is tests/semantic/test_interp_computed_ij_fallback.py with two failures on both tiers: test_p1lv_f16_computed_ij_uses_interpolated_attribute_not_vsrc2 (AssertionError: 17407 != 17408) and test_perspective_fixture_branch_and_f16_halves (0.07745361328125 != 0.0775146484375). Nothing in this PR touches interp fallback; main's CI is red the same way. **One semantic note for maintainers.** Vs current main the PR's net effect is 50 files, +10,234/-2,322. In runtime/src/bcpack.cpp, bcpack.h, shims/dstorage.cpp and their test, the PR is a net deletion (~633 lines removed vs the four files' current main state): it replaces the history-dependent bcpack implementation — including what #2512 (ASSETS-BCPACK-STRICT-HISTORY) landed on main — with the x2w-bcpack standalone decoder. #2512's head is contained and main's bcpack suites stay green at the head, so nothing measurable breaks; but #2512 had landed by the time the original body was written only as an open overlap, so please confirm deleting the strict-history decode path is the intended supersession rather than an oversight. CI at 7078256d18: windows, linux-gpu-tools, translator-tests, viewer-tests, change-scope, no-game-data pass; check, macos, macos-python, semantic-tests, stdlib-tests-linux fail, all inherited from main as shown above. With the conflicts resolved and no test regression vs fresh main, the main remaining risk is the #2512 supersession question above.
KelboLive commented 2026-11-30 16:53:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T16:53:48Z.


Independent check on Windows (not the author), at 7078256d1.

  • cargo test --locked -p leonida-formats --lib (shared warm target): 42 passed, 0 failed, 5 ignored in 5.7 s.
  • The BC1–BC7 standalone decode tests, including payload_step_matches_the_reference_decode, pass.

Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, Rust 1.98.1 pinned.

AI-assisted: yes (opencode).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7285398006 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7285398006). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-30T16:53:48Z. --- Independent check on Windows (not the author), at `7078256d1`. - `cargo test --locked -p leonida-formats --lib` (shared warm target): **42 passed, 0 failed, 5 ignored** in 5.7 s. - The BC1–BC7 standalone decode tests, including `payload_step_matches_the_reference_decode`, pass. Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, Rust 1.98.1 pinned. AI-assisted: yes (opencode).
deleted-user commented 2026-12-01 11:53:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by deleted-user on 2026-12-01T11:53:09Z.

Review: CHANGES_REQUESTED


Keeping #2567 over closed #1974 (#1974 only optimized the legacy fitted-history runtime/src/bcpack.cpp that this PR replaces with standalone BC1–BC7 decoding across C++, Rust, and Python).

Holding from merge until the current conflicts with main are resolved and CI is green.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130715100 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#pullrequestreview-6130715100). Originally posted by [deleted-user](https://github.com/deleted-user) on 2026-12-01T11:53:09Z. **Review:** CHANGES_REQUESTED --- Keeping **#2567** over closed **#1974** (`#1974` only optimized the legacy fitted-history `runtime/src/bcpack.cpp` that this PR replaces with standalone BC1–BC7 decoding across C++, Rust, and Python). Holding from merge until the current conflicts with `main` are resolved and CI is green. *(AI-assisted review.)*
Kal0s-design commented 2026-12-02 15:52:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T15:52:46Z.


Ran natively on Windows 11, head 7078256d1 tested on its own. It does not merge cleanly into current main (3c106eb2f): git merge-tree reports conflicts in 2 files, d3d12/crates/leonida-formats/src/bcpack.rs and tests/test_make_game_runtime_staging.py. Everything below ran at the PR head, except the main columns, which ran at 3c106eb2f in a separate build directory. CPU only, synthetic inputs only.

1. What the bcpack.rs conflict means (measured)

Since the PR's last main merge (b8bd37111), main has changed bcpack.rs through #2690 (AVX2 rANS model lookup), #2715 (BC7 index LUTs and 8-byte BC1/3/4/5 post-processing) and 1341d658b. This is from git log b8bd37111..main -- bcpack.rs.

The PR's 1,076 fixture rows through current main's Rust bcpack::decode:

Codec Rows Match Different bytes Rejected
BC1 49 24 0 25
BC2 49 0 0 49
BC3 49 49 0 0
BC4 49 24 0 25
BC5 49 49 0 0
BC6H 497 497 0 0
BC7 334 334 0 0

main already produces correct BC7 bytes (b589e0fe0, 1e090c6a9). The Rust side of this PR is therefore now BC2 support plus the BC1/BC4 streams main's lane scheduler rejects. main outputs no wrong bytes, it only rejects.

Rust decode speed, release build, single thread, MB of BC output per second. Medians of 3 interleaved runs, run-to-run spread about ±10%:

Input PR head main
Fixture rows, BC3 80 129
Fixture rows, BC5 78 134
Fixture rows, BC6H 32 46
Fixture rows, BC7 31 52
Crate bench bcpack_throughput (16,384 random blocks), BC1 63 119
Same, BC4 69 116
Same, BC7 43 80

If the conflict is resolved by taking the PR's bcpack.rs, the Rust DirectStorage decode gets about 1.4-1.9x slower. That would undo #2690 and #2715. Porting the BC2 and lane-scheduler fixes onto main's current file would keep both. The fixture table above is the check for that port.

2. Differential fuzz across the three implementations at the head (measured)

I built a corpus from the 1,076 goldens: every truncation length, 32 single-bit flips and 32 random overwrites of 1-4 bytes per row, zero and non-zero tails, 8 wrong destination sizes, codec ids 0-8 and 255, and 20,000 random streams of up to 2,048 bytes.

Implementation Inputs Panics / crashes Result
Rust, release 602,999 0 6,202 accepted, 0 inputs over 0.5 s. All 491,539 truncations rejected, all 2,152 non-zero tails rejected, zero tails always give identical bytes
Rust, debug (overflow checks on; 8 flips + 8 overwrites per row) about 551,000 0 0 inputs over 0.5 s
C++ x2w_bcpack reference / scalar / AVX2, MSVC 19.50 /O2 167,700 replayed from the Rust run (every 9th truncation length) 0 0 accept/reject disagreements with Rust, 0 byte differences on the 7,277 accepted inputs, on all 3 paths
Same C++, /fsanitize=address 167,700 × 3 paths 0 ASan reports identical tallies
Pure Python tools/bcpack.py, native lanes off 167,700 0 unexpected exceptions accepts 231 inputs that Rust and C++ reject (below)

A 64 or 512 MiB destination with a 64-byte source fails at once in Rust.

Two divergences, both on corrupt input only. Neither affects the goldens.

  1. The Python lane decoder accepts streams that both runtimes reject with invalid lane terminal state. By codec: BC1 7, BC2 6, BC3 7, BC4 15, BC5 5, BC6H 112, BC7 79 (out of 160,423 inputs Rust rejects). _decode_lanes_raw, which the PR leaves unchanged, has no equivalent of Rust's final-state check (final_state ∈ {LOW, 0x10000, 0x100}) or C++'s, so a non-flush fragment can end in any state. Smallest example: BC6H, 1 block. Python returns 562e3af030f4b3b28a419244dbb4ed2a; Rust and all three C++ paths reject it:
    10101010101004100404040404040404010101010104040400000202020101011070000000000000104003030302020200000202020505051010101010101010040404040404040410101001010101040808080202020200000000000000003809090903030303901111110202020200
    So the assets exporter could publish a DDS from a chunk both runtimes would fail. I did not trace this through the exporter.
  2. Partial writes on error. Measured: in 22 cases, Rust and C++ return failure after earlier blocks are already written to the destination. The errors are BC6H mode out of range and BC7 unused BC7 control code, both raised during block rebuild after the lanes decoded. The rest is from reading the code. The C++ DirectStorage shim decodes into scratch, so it is unaffected. The Rust HLE path (leonida-hle/src/modules/dstorage.rs, into_destination) decodes straight into title memory, both for non-paged destinations and for paged ones mapped as one contiguous window. In those cases a failed request leaves partly written texture data in title memory. Scattered page lists are staged first. main's bc6/bc7 return the same errors from inside the block loop, so this predates the PR.

Minor: for codec ids 0, 8 and 255 Python raises BcpackUnsupportedCodec. That is a NotImplementedError, not a BcpackError, so a caller that catches only BcpackError will not see it.

3. Block coverage of the emitted BC data (reading the fixture's expected bytes)

All 8 BC7 modes appear (mode 6: 8 blocks, mode 7: 3,140). All 14 BC6H modes appear (160-1,737 blocks each). BC1, BC2 and BC3 colour blocks have both endpoint orderings (c0 > c1 and c0 <= c1; only BC1 then selects the 3-colour/punch-through mode, 4,408 blocks), and BC3, BC4 and BC5 have both 6- and 8-value alpha. Across the 7,277 accepted fuzz outputs (141,316 BC7 and 137,077 BC6H blocks), no BC7 block had the invalid mode byte 0x00 and no BC6H block had a reserved mode. The decoders reject those records rather than emitting them.

4. Other speeds at the head (fixture rows, MB/s, single thread, timed separately from §1 under different machine load)

Codec C++ reference C++ scalar C++ AVX2 Python pure (3.11)
BC1 47 54 93 0.56
BC2 40 47 95 0.56
BC3 46 53 95 0.55
BC4 49 56 93 0.55
BC5 46 54 103 0.61
BC6H 20 23 30 0.24
BC7 25 30 45 0.31

5. Suites at the head (measured, matching earlier reports)

cargo test -p leonida-formats gives 42 passed, 5 ignored. The bcpack_test goldens pass on all 3 CPU paths. The PR's Python suites pass with -I: test_bcpack*, test_ttpf_*, test_make_game_assets_pools, test_make_game_runtime_staging and test_calibrated_texture_extra, 334 tests, 0 failures.

cargo clippy -p leonida-formats --all-targets -D warnings fails at the head with one error, precedence at texture.rs:1346. The PR does not touch that file, and the same command passes on current main. bcpack.rs and bcpack_bc2_tables.rs are clippy- and rustfmt-clean. Nit: with MSVC 19.50, runtime/test/bcpack_test.cpp:36 raises C4244 at /W4 because std::fill is called with int 0xa5.

Not checked: BCn to RGBA decoding on the GPU or WARP, per-mode texel error, and BC6H NaN/inf/denormal/sign handling. The PR stops at BC block bytes and contains no texel decoder, so these do not apply to it. Also not checked: the full Windows runtime / CMake build, the DirectStorage shim test, the optional native Python library, streams over 1,024 blocks from a real encoder, a hand-resolved merge with main, and any game run.

GPUs tested: n/a (CPU-only tests).

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7351079085 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7351079085). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-12-02T15:52:46Z. --- Ran natively on Windows 11, head `7078256d1` tested on its own. It does not merge cleanly into current `main` (`3c106eb2f`): `git merge-tree` reports conflicts in 2 files, `d3d12/crates/leonida-formats/src/bcpack.rs` and `tests/test_make_game_runtime_staging.py`. Everything below ran at the PR head, except the `main` columns, which ran at `3c106eb2f` in a separate build directory. CPU only, synthetic inputs only. ### 1. What the `bcpack.rs` conflict means (measured) Since the PR's last `main` merge (`b8bd37111`), `main` has changed `bcpack.rs` through #2690 (AVX2 rANS model lookup), #2715 (BC7 index LUTs and 8-byte BC1/3/4/5 post-processing) and `1341d658b`. This is from `git log b8bd37111..main -- bcpack.rs`. The PR's 1,076 fixture rows through current `main`'s Rust `bcpack::decode`: | Codec | Rows | Match | Different bytes | Rejected | | --- | --- | --- | --- | --- | | BC1 | 49 | 24 | 0 | 25 | | BC2 | 49 | 0 | 0 | 49 | | BC3 | 49 | 49 | 0 | 0 | | BC4 | 49 | 24 | 0 | 25 | | BC5 | 49 | 49 | 0 | 0 | | BC6H | 497 | 497 | 0 | 0 | | BC7 | 334 | 334 | 0 | 0 | `main` already produces correct BC7 bytes (b589e0fe0, 1e090c6a9). The Rust side of this PR is therefore now BC2 support plus the BC1/BC4 streams `main`'s lane scheduler rejects. `main` outputs no wrong bytes, it only rejects. Rust decode speed, release build, single thread, MB of BC output per second. Medians of 3 interleaved runs, run-to-run spread about ±10%: | Input | PR head | `main` | | --- | --- | --- | | Fixture rows, BC3 | 80 | 129 | | Fixture rows, BC5 | 78 | 134 | | Fixture rows, BC6H | 32 | 46 | | Fixture rows, BC7 | 31 | 52 | | Crate bench `bcpack_throughput` (16,384 random blocks), BC1 | 63 | 119 | | Same, BC4 | 69 | 116 | | Same, BC7 | 43 | 80 | If the conflict is resolved by taking the PR's `bcpack.rs`, the Rust DirectStorage decode gets about 1.4-1.9x slower. That would undo #2690 and #2715. Porting the BC2 and lane-scheduler fixes onto `main`'s current file would keep both. The fixture table above is the check for that port. ### 2. Differential fuzz across the three implementations at the head (measured) I built a corpus from the 1,076 goldens: every truncation length, 32 single-bit flips and 32 random overwrites of 1-4 bytes per row, zero and non-zero tails, 8 wrong destination sizes, codec ids 0-8 and 255, and 20,000 random streams of up to 2,048 bytes. | Implementation | Inputs | Panics / crashes | Result | | --- | --- | --- | --- | | Rust, release | 602,999 | 0 | 6,202 accepted, 0 inputs over 0.5 s. All 491,539 truncations rejected, all 2,152 non-zero tails rejected, zero tails always give identical bytes | | Rust, debug (overflow checks on; 8 flips + 8 overwrites per row) | about 551,000 | 0 | 0 inputs over 0.5 s | | C++ `x2w_bcpack` reference / scalar / AVX2, MSVC 19.50 `/O2` | 167,700 replayed from the Rust run (every 9th truncation length) | 0 | 0 accept/reject disagreements with Rust, 0 byte differences on the 7,277 accepted inputs, on all 3 paths | | Same C++, `/fsanitize=address` | 167,700 × 3 paths | 0 ASan reports | identical tallies | | Pure Python `tools/bcpack.py`, native lanes off | 167,700 | 0 unexpected exceptions | accepts **231** inputs that Rust and C++ reject (below) | A 64 or 512 MiB destination with a 64-byte source fails at once in Rust. Two divergences, both on corrupt input only. Neither affects the goldens. 1. **The Python lane decoder accepts streams that both runtimes reject** with `invalid lane terminal state`. By codec: BC1 7, BC2 6, BC3 7, BC4 15, BC5 5, BC6H 112, BC7 79 (out of 160,423 inputs Rust rejects). `_decode_lanes_raw`, which the PR leaves unchanged, has no equivalent of Rust's final-state check (`final_state` ∈ {`LOW`, `0x10000`, `0x100`}) or C++'s, so a non-flush fragment can end in any state. Smallest example: BC6H, 1 block. Python returns `562e3af030f4b3b28a419244dbb4ed2a`; Rust and all three C++ paths reject it: `10101010101004100404040404040404010101010104040400000202020101011070000000000000104003030302020200000202020505051010101010101010040404040404040410101001010101040808080202020200000000000000003809090903030303901111110202020200` So the assets exporter could publish a DDS from a chunk both runtimes would fail. I did not trace this through the exporter. 2. **Partial writes on error.** Measured: in 22 cases, Rust and C++ return failure after earlier blocks are already written to the destination. The errors are BC6H `mode out of range` and BC7 `unused BC7 control code`, both raised during block rebuild after the lanes decoded. The rest is from reading the code. The C++ DirectStorage shim decodes into `scratch`, so it is unaffected. The Rust HLE path (`leonida-hle/src/modules/dstorage.rs`, `into_destination`) decodes straight into title memory, both for non-paged destinations and for paged ones mapped as one contiguous window. In those cases a failed request leaves partly written texture data in title memory. Scattered page lists are staged first. `main`'s `bc6`/`bc7` return the same errors from inside the block loop, so this predates the PR. Minor: for codec ids 0, 8 and 255 Python raises `BcpackUnsupportedCodec`. That is a `NotImplementedError`, not a `BcpackError`, so a caller that catches only `BcpackError` will not see it. ### 3. Block coverage of the emitted BC data (reading the fixture's expected bytes) All 8 BC7 modes appear (mode 6: 8 blocks, mode 7: 3,140). All 14 BC6H modes appear (160-1,737 blocks each). BC1, BC2 and BC3 colour blocks have both endpoint orderings (`c0 > c1` and `c0 <= c1`; only BC1 then selects the 3-colour/punch-through mode, 4,408 blocks), and BC3, BC4 and BC5 have both 6- and 8-value alpha. Across the 7,277 accepted fuzz outputs (141,316 BC7 and 137,077 BC6H blocks), no BC7 block had the invalid mode byte `0x00` and no BC6H block had a reserved mode. The decoders reject those records rather than emitting them. ### 4. Other speeds at the head (fixture rows, MB/s, single thread, timed separately from §1 under different machine load) | Codec | C++ reference | C++ scalar | C++ AVX2 | Python pure (3.11) | | --- | --- | --- | --- | --- | | BC1 | 47 | 54 | 93 | 0.56 | | BC2 | 40 | 47 | 95 | 0.56 | | BC3 | 46 | 53 | 95 | 0.55 | | BC4 | 49 | 56 | 93 | 0.55 | | BC5 | 46 | 54 | 103 | 0.61 | | BC6H | 20 | 23 | 30 | 0.24 | | BC7 | 25 | 30 | 45 | 0.31 | ### 5. Suites at the head (measured, matching earlier reports) `cargo test -p leonida-formats` gives 42 passed, 5 ignored. The `bcpack_test` goldens pass on all 3 CPU paths. The PR's Python suites pass with `-I`: `test_bcpack*`, `test_ttpf_*`, `test_make_game_assets_pools`, `test_make_game_runtime_staging` and `test_calibrated_texture_extra`, 334 tests, 0 failures. `cargo clippy -p leonida-formats --all-targets -D warnings` fails at the head with one error, `precedence` at `texture.rs:1346`. The PR does not touch that file, and the same command passes on current `main`. `bcpack.rs` and `bcpack_bc2_tables.rs` are clippy- and rustfmt-clean. Nit: with MSVC 19.50, `runtime/test/bcpack_test.cpp:36` raises C4244 at `/W4` because `std::fill` is called with `int` `0xa5`. **Not checked:** BCn to RGBA decoding on the GPU or WARP, per-mode texel error, and BC6H NaN/inf/denormal/sign handling. The PR stops at BC block bytes and contains no texel decoder, so these do not apply to it. Also not checked: the full Windows runtime / CMake build, the DirectStorage shim test, the optional native Python library, streams over 1,024 blocks from a real encoder, a hand-resolved merge with `main`, and any game run. GPUs tested: n/a (CPU-only tests). AI-assisted: yes (Claude Code).
MoonEyes commented 2026-12-02 18:01:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:01:33Z.


Triage only: head 7078256d1 conflicts with current main 45dc41f95, and five CI jobs fail on that head. Not tested further.

merge base b8bd37111 (1,223 commits behind main)
git merge-tree --write-tree origin/main refs/pull/2567/head
CONFLICT (content): d3d12/crates/leonida-formats/src/bcpack.rs
CONFLICT: tests/test_make_game_runtime_staging.py

CI on 7078256d1 (2026-11-30): stdlib-tests-linux, macos-python, check, semantic-tests (ubuntu-latest) and macos all failure. The stdlib-tests-linux log fails in tests/test_dstorage_multilevel_fit.py, for example:

FAIL: test_bc7_four_level_downsample_averages_full_footprint_across_alternating_columns
AssertionError: 127.0 not less than or equal to 4 : blk 0 ch 0: 0.0 vs 127
FAIL: test_refused_bc6h_intermediate_sibling_falls_back_to_multilevel_zlib_mip
AssertionError: 4352.0 not less than or equal to 64.0 : parent blk 0 ch 0

That suite exercises the BC7/BC6H paths this PR replaces (tools/bcpack.py -993 lines, runtime/src/bcpack.cpp -424 lines), so these are probably caused by the change, not by the runner. I have not confirmed that on a merge because the branch does not merge.

Scope note for review once it is rebased: 50 files, including about 6,000 lines vendored under third_party/x2w-bcpack/ (bcpack_tables*.h/.inl) and tools/bcpack_standalone_tables.json. Per CONTRIBUTING.md, a reviewer should confirm where those tables come from (an MIT-licensed decoder, or values measured from retail data) before merge, and run python -I scripts/check_no_game_data.py on them. Splitting the vendored decoder from the tool and runtime changes would make the review tractable.

The branch has been conflicting since 2026-11-29 (noted by @fiestorra and @MoonEyes) with no push since 2026-11-30.

Verdict: conflict (also blocked on CI failures).

AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7353871570 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7353871570). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:01:33Z. --- **Triage only: head `7078256d1` conflicts with current `main` `45dc41f95`, and five CI jobs fail on that head. Not tested further.** ``` merge base b8bd37111 (1,223 commits behind main) git merge-tree --write-tree origin/main refs/pull/2567/head CONFLICT (content): d3d12/crates/leonida-formats/src/bcpack.rs CONFLICT: tests/test_make_game_runtime_staging.py ``` **CI on `7078256d1` (2026-11-30):** `stdlib-tests-linux`, `macos-python`, `check`, `semantic-tests (ubuntu-latest)` and `macos` all `failure`. The `stdlib-tests-linux` log fails in `tests/test_dstorage_multilevel_fit.py`, for example: ``` FAIL: test_bc7_four_level_downsample_averages_full_footprint_across_alternating_columns AssertionError: 127.0 not less than or equal to 4 : blk 0 ch 0: 0.0 vs 127 FAIL: test_refused_bc6h_intermediate_sibling_falls_back_to_multilevel_zlib_mip AssertionError: 4352.0 not less than or equal to 64.0 : parent blk 0 ch 0 ``` That suite exercises the BC7/BC6H paths this PR replaces (`tools/bcpack.py` -993 lines, `runtime/src/bcpack.cpp` -424 lines), so these are probably caused by the change, not by the runner. I have not confirmed that on a merge because the branch does not merge. **Scope note for review once it is rebased:** 50 files, including about 6,000 lines vendored under `third_party/x2w-bcpack/` (`bcpack_tables*.h/.inl`) and `tools/bcpack_standalone_tables.json`. Per CONTRIBUTING.md, a reviewer should confirm where those tables come from (an MIT-licensed decoder, or values measured from retail data) before merge, and run `python -I scripts/check_no_game_data.py` on them. Splitting the vendored decoder from the tool and runtime changes would make the review tractable. The branch has been conflicting since 2026-11-29 (noted by @fiestorra and @MoonEyes) with no push since 2026-11-30. **Verdict: conflict** (also blocked on CI failures). AI-assisted verification: Claude Opus (Claude Code), separate agent per batch. --- _Generated by [Claude Code](https://claude.ai/code)_
MoonEyes commented 2026-12-02 22:01:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T22:01:43Z.


This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).

Could you, or anyone with a working setup, post a run report on the current head merged onto current main:

  • the head SHA and the main SHA it was merged onto;
  • GPU, driver and OS;
  • at least 300 s in the world after loading;
  • device lost / crashes (count), and rendered fps (median) if you have them;
  • the same run on main alone for comparison, if you can.

Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7360121828 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7360121828). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T22:01:43Z. --- This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists). Could you, or anyone with a working setup, post a run report on the **current head** merged onto current `main`: - the head SHA and the `main` SHA it was merged onto; - GPU, driver and OS; - at least 300 s in the world after loading; - device lost / crashes (count), and rendered fps (median) if you have them; - the same run on `main` alone for comparison, if you can. Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough. AI-assisted (Claude Code).
fiestorra commented 2026-12-03 07:02:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T07:02:28Z.


VERIFY-2567 — 208 tests y 1289 subtests en verde en la PR de decodificación de BC1–BC7, y el 1118 es el número que importa

50 ficheros, +10 234: 8 en runtime/, 13 en tools/, 12 en tests/, 2 en d3d12/. Los tests de Python que toca, corridos en su árbol:

tests/test_bcpack.py              20 passed + 3 subtests
tests/test_bcpack_standalone.py    3 passed + 1118 subtests     ← el que importa
tests/test_bcpack_tables.py       34 passed
tests/test_bcpack_tool.py         28 passed
tests/test_ttpf_assets.py         30 passed + 2 skipped + 12 subtests
tests/test_ttpf_mips.py           93 passed + 159 subtests
                                 ─────────────────────────────
                                 208 tests, 1289 subtests, 0 fallos

Y 1118 subtests en un fichero con 3 tests significa una cosa: la tabla de decodificación se comprueba entrada por entrada, que es exactamente cómo se prueba un decodificador de bloques comprimidos — no con tres casos elegidos a mano, sino con el espacio entero.

Lo que la PR hace, por su título: decodificación BC1–BC7 standalone, es decir sin las bibliotecas del sistema, en los dos runtimes y en las herramientas de assets. Y la razón de que exista: un bloque BC decodificado de forma distinta en el runtime C++ y en el port es una textura que se ve distinta sin que nadie sepa por qué — la misma familia que #2686, #2807 y #2698: dos implementaciones de lo mismo y ninguna forma de compararlas.

Lo que verifiqué: los seis ficheros de test de las herramientas que toca, y que los 1289 subtests pasan.
Lo que no: la decodificación en la GPU ni en el runtime C++ — eso es el build de 50 ficheros y necesita el juego con sus texturas. Lo que sí puedo decir es que la parte que se puede comprobar sin GPU está comprobada exhaustivamente, y que es la parte donde un error de tabla se propaga a todas las texturas.

Y una nota sobre el 2 skipped de ttpf_assets: los dos que se saltan son de assets que no están en este checkout, y el test lo dice en vez de fallar — la misma elección que hice en mi guarda de i18n, por el mismo motivo.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7370524316 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7370524316). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T07:02:28Z. --- ## VERIFY-2567 — **208 tests y 1289 subtests en verde** en la PR de decodificación de BC1–BC7, y el `1118` es el número que importa **50 ficheros, +10 234**: **8 en `runtime/`, 13 en `tools/`, 12 en `tests/`, 2 en `d3d12/`.** **Los tests de Python que toca, corridos en su árbol**: ``` tests/test_bcpack.py 20 passed + 3 subtests tests/test_bcpack_standalone.py 3 passed + 1118 subtests ← el que importa tests/test_bcpack_tables.py 34 passed tests/test_bcpack_tool.py 28 passed tests/test_ttpf_assets.py 30 passed + 2 skipped + 12 subtests tests/test_ttpf_mips.py 93 passed + 159 subtests ───────────────────────────── 208 tests, 1289 subtests, 0 fallos ``` **Y `1118 subtests` en un fichero con 3 tests significa una cosa**: **la tabla de decodificación se comprueba entrada por entrada**, **que es exactamente cómo se prueba un decodificador de bloques comprimidos** — **no con tres casos elegidos a mano, sino con el espacio entero.** **Lo que la PR hace, por su título**: **decodificación BC1–BC7 *standalone*, es decir sin las bibliotecas del sistema, en los dos runtimes y en las herramientas de assets.** **Y la razón de que exista**: **un bloque BC decodificado de forma distinta en el runtime C++ y en el port es una textura que se ve distinta sin que nadie sepa por qué** — **la misma familia que `#2686`, `#2807` y `#2698`: dos implementaciones de lo mismo y ninguna forma de compararlas.** **Lo que verifiqué**: **los seis ficheros de test de las herramientas que toca, y que los 1289 subtests pasan.** **Lo que no**: **la decodificación en la GPU ni en el runtime C++** — **eso es el build de 50 ficheros y necesita el juego con sus texturas.** **Lo que sí puedo decir es que la parte que se puede comprobar sin GPU está comprobada exhaustivamente, y que es la parte donde un error de tabla se propaga a todas las texturas.** **Y una nota sobre el `2 skipped` de `ttpf_assets`**: **los dos que se saltan son de assets que no están en este checkout**, **y el test lo dice en vez de fallar** — **la misma elección que hice en mi guarda de i18n, por el mismo motivo.**
fiestorra commented 2026-12-03 10:08:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T10:08:47Z.


Estado de la rebasada, medido hoy: no es de las mecánicas, y mejor saberlo antes de empezar.

50 files changed, +10234/−2322
merge-tree choca en:   d3d12/crates/leonida-formats/src/bcpack.rs
                       tests/test_make_game_runtime_staging.py
cherry-pick del rango sobre d9b618f10: CONFLICTO en 15 ficheros
    README.md · d3d12/crates/leonida-formats/src/bcpack.rs · docs/directstorage.md
    make_game.py · runtime/CMakeLists.txt · runtime/shims/dstorage.cpp
    runtime/src/bcpack.cpp · runtime/src/bcpack.h · runtime/test/dstorage_test.cpp
    runtime/test/dstorage_vectors.py · tests/test_bcpack_history_calib.py
    tests/test_ttpf_assets.py · tools/bcpack_calibration/README.md
    tools/bcpack_tool.py · tools/gen_bcpack_runtime_tables.py

Y la diferencia entre las dos listas es la de siempre: merge-tree dice en qué choca la fusión de dos árboles, y el cherry-pick dice en qué choca aplicar el parche commit a commit — quince contra dos, porque la PR es anterior a la reorganización de runtime/ y tools/.

Lo que ya está comprobado y no hace falta repetir (lo corrí en la sesión del 2-dic): pytest tests/test_bcpack_history_calib.py tests/test_ttpf_assets.py → 208 tests y 1289 subtests, en verde, y el bcpack_test del runtime compilado y ejecutado. Lo que no: si sigue en verde sobre main de hoy, porque para eso hay que rebasarla y esos quince conflictos son de contenido, no de posición (runtime/ cambió de sitio).

No la voy a rebasar yo: 15 ficheros es tocar el trabajo de otro sin poder ejecutar el juego, y prefiero decirlo antes que dejar un rebase a medias.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7374802503 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7374802503). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T10:08:47Z. --- **Estado de la rebasada, medido hoy**: **no es de las mecánicas, y mejor saberlo antes de empezar.** ``` 50 files changed, +10234/−2322 merge-tree choca en: d3d12/crates/leonida-formats/src/bcpack.rs tests/test_make_game_runtime_staging.py cherry-pick del rango sobre d9b618f10: CONFLICTO en 15 ficheros README.md · d3d12/crates/leonida-formats/src/bcpack.rs · docs/directstorage.md make_game.py · runtime/CMakeLists.txt · runtime/shims/dstorage.cpp runtime/src/bcpack.cpp · runtime/src/bcpack.h · runtime/test/dstorage_test.cpp runtime/test/dstorage_vectors.py · tests/test_bcpack_history_calib.py tests/test_ttpf_assets.py · tools/bcpack_calibration/README.md tools/bcpack_tool.py · tools/gen_bcpack_runtime_tables.py ``` **Y la diferencia entre las dos listas es la de siempre**: **`merge-tree` dice en qué choca la fusión de dos árboles**, **y el cherry-pick dice en qué choca aplicar el parche commit a commit** — **quince contra dos**, **porque la PR es anterior a la reorganización de `runtime/` y `tools/`.** **Lo que ya está comprobado y no hace falta repetir** (**lo corrí en la sesión del 2-dic**): **`pytest tests/test_bcpack_history_calib.py tests/test_ttpf_assets.py` → 208 tests y 1289 subtests, en verde**, **y el `bcpack_test` del runtime compilado y ejecutado**. **Lo que no**: **si sigue en verde sobre `main` de hoy**, **porque para eso hay que rebasarla y esos quince conflictos son de contenido, no de posición** (**`runtime/` cambió de sitio**). **No la voy a rebasar yo**: **15 ficheros es tocar el trabajo de otro sin poder ejecutar el juego, y prefiero decirlo antes que dejar un rebase a medias.**
merzleckeier commented 2026-12-03 13:09:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T13:09:29Z.


I rechecked the refreshed head ea26edfb on Linux. It includes main b053a181 and also merges cleanly with #3271 (cfecc6ba).

  • C++ and Rust matched all 1,076 synthetic BC1–BC7 references. The full Rust formats suite had 48 passes and eight existing ignores.
  • Python without site packages matched all 1,076 references with native acceleration disabled. With the optional Rust entropy library built, I counted calls and compared the lane records and consumed byte count with pure Python. The native decoder handled all 1,076 cases with zero fallbacks, and every reconstructed result still matched the references.
  • On the combined tree without NumPy: 93 TTPF mip tests passed and the asset suite had 33 passes and one skip. Both optional BC feature test classes skipped cleanly. With NumPy, all eight feature tests passed. The runtime installer passed all 13 staging tests.

The earlier merge conflicts are resolved on this head. CI, D3D12 runtime, and No Game Data all succeeded on ea26edfb. This was synthetic CPU verification. The in-game gate remains open.

AI-assisted (Codex).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7379398298 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7379398298). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T13:09:29Z. --- I rechecked the refreshed head `ea26edfb` on Linux. It includes `main` `b053a181` and also merges cleanly with #3271 (`cfecc6ba`). - C++ and Rust matched all 1,076 synthetic BC1–BC7 references. The full Rust formats suite had 48 passes and eight existing ignores. - Python without site packages matched all 1,076 references with native acceleration disabled. With the optional Rust entropy library built, I counted calls and compared the lane records and consumed byte count with pure Python. The native decoder handled all 1,076 cases with zero fallbacks, and every reconstructed result still matched the references. - On the combined tree without NumPy: 93 TTPF mip tests passed and the asset suite had 33 passes and one skip. Both optional BC feature test classes skipped cleanly. With NumPy, all eight feature tests passed. The runtime installer passed all 13 staging tests. The earlier merge conflicts are resolved on this head. CI, D3D12 runtime, and No Game Data all succeeded on `ea26edfb`. This was synthetic CPU verification. The in-game gate remains open. AI-assisted (Codex).
merzleckeier commented 2026-12-03 13:14:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T13:14:48Z.


Rust throughput after the ea26edfb refresh. Following up on the earlier measurements, the refresh improves throughput over 7078256d in every codec I measured. It still delivers 24–32% less output per second than main (b053a181) on inputs all three builds decode correctly.

Codec b053a181 7078256d ea26edfb
BC1 94.8 66.4 68.3
BC2 — 61.4 67.0
BC3 113.2 66.7 77.1
BC4 115.9 68.0 79.1
BC5 112.6 65.8 76.3
BC6H 55.1 38.9 41.7
BC7 66.9 38.6 48.7

Figures are median MB of decoded BC output per second across six interleaved samples per build. I compiled the three bcpack::decode versions with rustc 1.98.1 (-C opt-level=3 -C codegen-units=1) on Linux and pinned the thread to one core of a Ryzen 7 7800X3D. Both PR revisions matched all 1,076 committed synthetic reference outputs. The time trials used the shared byte-exact cases per codec, with reused output buffers. BC2 compares the two PR revisions because main lacks BC2 support.

The gap persisted on a second physical core (23–31%) and on the 8–16 KiB output subset with rustc 1.97.1 and reversed run order (24–33%). This measures CPU decoder throughput on synthetic inputs. The requested in-game run remains open.

AI-assisted (Codex).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7379528006 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7379528006). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T13:14:48Z. --- **Rust throughput after the `ea26edfb` refresh.** Following up on the [earlier measurements](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7351079085), the refresh improves throughput over `7078256d` in every codec I measured. It still delivers **24–32% less output per second** than `main` (`b053a181`) on inputs all three builds decode correctly. | Codec | `b053a181` | `7078256d` | `ea26edfb` | | --- | ---: | ---: | ---: | | BC1 | 94.8 | 66.4 | 68.3 | | BC2 | — | 61.4 | 67.0 | | BC3 | 113.2 | 66.7 | 77.1 | | BC4 | 115.9 | 68.0 | 79.1 | | BC5 | 112.6 | 65.8 | 76.3 | | BC6H | 55.1 | 38.9 | 41.7 | | BC7 | 66.9 | 38.6 | 48.7 | Figures are median MB of decoded BC output per second across six interleaved samples per build. I compiled the three `bcpack::decode` versions with rustc 1.98.1 (`-C opt-level=3 -C codegen-units=1`) on Linux and pinned the thread to one core of a Ryzen 7 7800X3D. Both PR revisions matched all 1,076 committed synthetic reference outputs. The time trials used the shared byte-exact cases per codec, with reused output buffers. BC2 compares the two PR revisions because `main` lacks BC2 support. The gap persisted on a second physical core (23–31%) and on the 8–16 KiB output subset with rustc 1.97.1 and reversed run order (24–33%). This measures CPU decoder throughput on synthetic inputs. The requested in-game run remains open. AI-assisted (Codex).
EdenBendheim commented 2026-12-03 13:45:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by EdenBendheim on 2026-12-03T13:45:20Z.


RUN (RTX 3090 24 GB) — both exact-head candidate and main-only 300 s compatibility gates PASS.

  • Candidate ea26edfb15aa223a0e846b37d71ef6d6f3aa205e contains pinned main b053a1813c8980c4357d51bbe6e69a35dc8c476c (merge no-op). Candidate exe SHA-256 be2046d3c49a847445dd516ffbd27fd6d6db2c67600758ca1784296b64d18e4e; main 8ddb36f22fd4c0883f3d633cb9317f40c26d5b24c73302115939554a8895d576. Both locked Rust 1.98.1, diagnostics,dlss,mimalloc.
  • RTX 3090 driver 610.88, Windows 11 Home build 26200, Ryzen 9 5900X, 32 GiB RAM (Profile L). Series S stretch, no FG/precompile, stock gate, same settings and initial hash-matched private pipeline seed.
MEASURED Candidate Main
World seconds 301.943 305.381
Actual exit / device losses / crashes 0 / 0 / 0 0 / 0 / 0
Median/p5 FPS 13.36 / 3.39 12.17 / 2.14
p95/p99 frame time ms 294.68 / 742.82 466.60 / 1313.60
Longest in-world present gap s 3.742 3.042
Peak private / min commit MiB 24185 / 5192 22869 / 6502
Peak VRAM MiB 7054 6291
Aggregate reported DirectStorage requests 216287 183566
Sum of reported per-interval BC destination-size MB 596 419
Positive BC telemetry rows / total 42 / 72 33 / 71
Reported staging waits / BC request failure logs 0 / 0 0 / 0

World+60 measured 2,157/1,586 present intervals, draw medians 5,359.5/8,473; zero sampled pipeline-busy windows. DirectStorage in this window reported 106,620/80,268 completed requests and 317/171 MB of BC destination-size counters. These counters are truncated per report and omit the final partial interval; they are not exact decoded bytes. Both runs showed substantial streaming activity, no logged request/table failures or device losses, and cache saved on normal target stop. Both native placements confirmed; 25/25 vs 19/19 near-location samples, sustained observed suffix 243.967/192.098 s. The different workloads and time at location preclude FPS or throughput attribution.

Synthetic Rust BC tests: 17 passed, 4 ignored on candidate; 16 passed, 4 ignored on main; zero failures. Candidate includes independent 1,076 synthetic golden fixture test. Author's existing red evidence not repeated. No per-codec coverage or visual correctness conclusion from the runtime gate. Clean-room file scan and diff check passed; author explicitly notes implementation inspection and synthetic GDK oracle in provenance. This report covers compatibility and existing synthetic tests only, no additional SDK code or game payloads copied.

AI-assisted: Codex GPT-6.2 Sol (tester and independent numeric check). No game content attached.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7380335464 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2567#issuecomment-7380335464). Originally posted by [EdenBendheim](https://github.com/EdenBendheim) on 2026-12-03T13:45:20Z. --- **RUN (RTX 3090 24 GB) — both exact-head candidate and main-only 300 s compatibility gates PASS.** - Candidate `ea26edfb15aa223a0e846b37d71ef6d6f3aa205e` contains pinned main `b053a1813c8980c4357d51bbe6e69a35dc8c476c` (merge no-op). Candidate exe SHA-256 `be2046d3c49a847445dd516ffbd27fd6d6db2c67600758ca1784296b64d18e4e`; main `8ddb36f22fd4c0883f3d633cb9317f40c26d5b24c73302115939554a8895d576`. Both locked Rust 1.98.1, diagnostics,dlss,mimalloc. - RTX 3090 driver 610.88, Windows 11 Home build 26200, Ryzen 9 5900X, 32 GiB RAM (Profile L). Series S stretch, no FG/precompile, stock gate, same settings and initial hash-matched private pipeline seed. | MEASURED | Candidate | Main | |---|---:|---:| | World seconds | 301.943 | 305.381 | | Actual exit / device losses / crashes | 0 / 0 / 0 | 0 / 0 / 0 | | Median/p5 FPS | 13.36 / 3.39 | 12.17 / 2.14 | | p95/p99 frame time ms | 294.68 / 742.82 | 466.60 / 1313.60 | | Longest in-world present gap s | 3.742 | 3.042 | | Peak private / min commit MiB | 24185 / 5192 | 22869 / 6502 | | Peak VRAM MiB | 7054 | 6291 | | Aggregate reported DirectStorage requests | 216287 | 183566 | | Sum of reported per-interval BC destination-size MB | 596 | 419 | | Positive BC telemetry rows / total | 42 / 72 | 33 / 71 | | Reported staging waits / BC request failure logs | 0 / 0 | 0 / 0 | World+60 measured 2,157/1,586 present intervals, draw medians 5,359.5/8,473; zero sampled pipeline-busy windows. DirectStorage in this window reported 106,620/80,268 completed requests and 317/171 MB of BC destination-size counters. These counters are truncated per report and omit the final partial interval; they are not exact decoded bytes. Both runs showed substantial streaming activity, no logged request/table failures or device losses, and cache saved on normal target stop. Both native placements confirmed; 25/25 vs 19/19 near-location samples, sustained observed suffix 243.967/192.098 s. The different workloads and time at location preclude FPS or throughput attribution. Synthetic Rust BC tests: 17 passed, 4 ignored on candidate; 16 passed, 4 ignored on main; zero failures. Candidate includes independent 1,076 synthetic golden fixture test. Author's existing red evidence not repeated. No per-codec coverage or visual correctness conclusion from the runtime gate. Clean-room file scan and diff check passed; author explicitly notes implementation inspection and synthetic GDK oracle in provenance. This report covers compatibility and existing synthetic tests only, no additional SDK code or game payloads copied. AI-assisted: Codex GPT-6.2 Sol (tester and independent numeric check). No game content attached.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2567:upstream-pr/2567'
git switch 'upstream-pr/2567'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2567'
git switch 'upstream-pr/2567'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2567'
git switch 'upstream-pr/2567'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2567'
git switch 'main'
git merge --squash 'upstream-pr/2567'
git switch 'main'
git merge --ff-only 'upstream-pr/2567'
git switch 'main'
git merge 'upstream-pr/2567'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2567
No description provided.