fix(bcpack): standalone BC1-BC7 decoding across runtimes and assets #2567
Open
github-bot
wants to merge 4 commits from
github-bot/gh-2567 into main
AGit
pull from: github-bot/gh-2567
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!2567
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2567"
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?
@wish131400 on GitHub · 2026-11-28 08:48 UTC · original
wish131400:bcpack/standalone-correctness→main· +10320 −2327 · 52 files · 4 commits · openClaim: BCPACK-STANDALONE-BC1-BC7.
Depends on: no unmerged PRs. Updated by a normal merge of
mainatb053a1813c8980c4357d51bbe6e69a35dc8c476c; 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.
d049001ab9a906588f47868277b77e9a00e27053(#3293), preserving notices and scalar/CPU-checked AVX2 dispatch.bcpack_research.py; legacy quality/history arguments cannot change production output.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
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:
leonida-formats: 48 passed, 8 existing ignored, 0 failed; Clippy with--all-targets -- -D warningsand formatting passed.b053a1813fail atbc1-ep0-ix0(stream ends early/corrupt). The merged decoder passes all 1,076 goldens, including scalar/dispatched lane parity.--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
@ecox982745 on GitHub · 2026-11-28 09:03 UTC · original
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 bothgta6rt.exeanddstorage_test.exewithLEONIDA_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:
S_OKand exact output.S_OKand 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 on GitHub · 2026-11-28 09:31 UTC · original · approved these changes
Reviewed the core Rust, C++, DirectStorage shim, vendored
third_party/x2w-bcpackdecoder, Python standalone integration, and license/notice files, and tested merged ontomain(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
d3d12/crates/leonida-formats/src/bcpack.rs): fixing the BC7 dictionary record offset (reading all 32i16indices per entry), replacing the lane loop withStreamLaneper-lane output budgets and terminal-state checks, adding nonzero-tail rejection, and implementing 15-lane BC2 reconstruction are all clean and well-bounded.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_TESTSstays confined tobcpack_testso there is no ODR mismatch ingta6rt_bcpack; attribution (LICENSE-MIT,THIRD_PARTY_NOTICES.md) and provenance/overlap notes (docs/bcpack-standalone.md) are clear. (Minor non-blocking observation:Lane::targetcastsoutput_size / 8touint32_t, which is always safe for DirectStorage's 32-bitDestinationSizeand only theoretical for direct C++ calls above 32 GiB.)tools/bcpack.py,tools/bcpack_standalone.py,tools/ttpf_assets.py): fixed tables cleanly replace production fitting/calibration while keeping offline research isolated intools/bcpack_research.pyand invalidating old stamps viaDECODER_SOURCES.Tests run
cmake --build <build> --target bcpack_test dstorage_test gta6rt): built cleanly withLEONIDA_BUILD_WINDOWS_RUNTIME=ON.ctest --output-on-failure -R "^(bcpack|dstorage)$": 2/2 passed (bcpack,dstorage5.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).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 on GitHub · 2026-11-28 09:54 UTC · original
@wish131400 —
VERIFY-2567-LINUX-VEGA20: tested3501c5bfmerged cleanly with3ca0707dd, 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.pystill recommends a local calibration profile for assets, but productionttpf_assets.load_profile()no longer reads one.AI-assisted.
@wish131400 on GitHub · 2026-11-28 11:37 UTC · original
Updated to
cb947eac0by mergingmainat4a54aedcb; the published decoder commit is preserved and no force push was used.make_game.pymodule 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 on GitHub · 2026-11-29 13:49 UTC · original · reviewed
Independent review pass (overnight shift; verification from a Windows x64 checkout, Python 3.14.9).
Claim protocol: verified.
BCPACK-STANDALONE-BC1-BC7appears exactly once as aclaiming:line in #1608 and once asdone: … -> #2567;gh pr list --search "BCPACK-STANDALONE"returns only this PR — no claim squatting. Body declaresAI-assisted: yes — CodexandGPUs tested: n/ahonestly, 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). Thelen(cases) == 1076assertion fired, so the fixture count is real.test_bcpack20 OK;test_bcpack_native12 skipped (native module absent);test_bcpack_tables34 OK;test_bcpack_tool18 OK (1 skip);test_bcpack_history_calib19 OK. Total: 106 tests, 0 failures.Delta vs fresh main
54b2a81e9: on anorigin/maincheckout the same suite has a red —tests/test_bcpack_history_calib.py::test_resolve_pools_deduplicates_macos_case_and_accents_and_keeps_case_sensitivefails (AssertionError: 1 != 2), andtest_bcpack_standalone.pydoes not exist on main at all. At the PR head that file is green. Note the greenness partly comes from removing five test methods fromtest_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
mainat4a54aedcb, 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 ofpr2567(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; failslinux-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 on GitHub · 2026-11-29 17:38 UTC · original
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/headreports 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 on GitHub · 2026-11-29 21:54 UTC · original
Tried
cb947eac0againstmain060c47160(Windows 11, Rust toolchain fromd3d12/rust-toolchain.toml, CPU only): it no longer merges,git mergeconflicts withmain. Not tested further.mainalone,cargo test -p leonida-formats --lockedgives 41 passed, 5 ignored, and clippy has 0 findings for that crate.main? I will rerun the tests on the new head.AI-assisted (Claude Code).
@GrahamboJangles on GitHub · 2026-11-30 08:25 UTC · original · reviewed
Follow-up re-check after the reconcile push (head
cb947eac0->7078256d18), 2026-11-30.Merge reconciliation verified. The new merge commit
7078256d18has second parentb8bd37111, 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 sinceb8bd37111is 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):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 on GitHub · 2026-11-30 16:53 UTC · original
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.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).
@ on GitHub · 2026-12-01 11:53 UTC · original · requested changes
Keeping #2567 over closed #1974 (
#1974only optimized the legacy fitted-historyruntime/src/bcpack.cppthat this PR replaces with standalone BC1–BC7 decoding across C++, Rust, and Python).Holding from merge until the current conflicts with
mainare resolved and CI is green.(AI-assisted review.)
@Kal0s-design on GitHub · 2026-12-02 15:52 UTC · original
Ran natively on Windows 11, head
7078256d1tested on its own. It does not merge cleanly into currentmain(3c106eb2f):git merge-treereports conflicts in 2 files,d3d12/crates/leonida-formats/src/bcpack.rsandtests/test_make_game_runtime_staging.py. Everything below ran at the PR head, except themaincolumns, which ran at3c106eb2fin a separate build directory. CPU only, synthetic inputs only.1. What the
bcpack.rsconflict means (measured)Since the PR's last
mainmerge (b8bd37111),mainhas changedbcpack.rsthrough #2690 (AVX2 rANS model lookup), #2715 (BC7 index LUTs and 8-byte BC1/3/4/5 post-processing) and1341d658b. This is fromgit log b8bd37111..main -- bcpack.rs.The PR's 1,076 fixture rows through current
main's Rustbcpack::decode:mainalready produces correct BC7 bytes (b589e0fe0,1e090c6a9). The Rust side of this PR is therefore now BC2 support plus the BC1/BC4 streamsmain's lane scheduler rejects.mainoutputs 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%:
mainbcpack_throughput(16,384 random blocks), BC1If 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 ontomain'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.
x2w_bcpackreference / scalar / AVX2, MSVC 19.50/O2/fsanitize=addresstools/bcpack.py, native lanes offA 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.
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 returns562e3af030f4b3b28a419244dbb4ed2a; Rust and all three C++ paths reject it:10101010101004100404040404040404010101010104040400000202020101011070000000000000104003030302020200000202020505051010101010101010040404040404040410101001010101040808080202020200000000000000003809090903030303901111110202020200So the assets exporter could publish a DDS from a chunk both runtimes would fail. I did not trace this through the exporter.
mode out of rangeand BC7unused BC7 control code, both raised during block rebuild after the lanes decoded. The rest is from reading the code. The C++ DirectStorage shim decodes intoscratch, 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'sbc6/bc7return 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 aNotImplementedError, not aBcpackError, so a caller that catches onlyBcpackErrorwill 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 > c1andc0 <= 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 byte0x00and 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)
5. Suites at the head (measured, matching earlier reports)
cargo test -p leonida-formatsgives 42 passed, 5 ignored. Thebcpack_testgoldens 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_stagingandtest_calibrated_texture_extra, 334 tests, 0 failures.cargo clippy -p leonida-formats --all-targets -D warningsfails at the head with one error,precedenceattexture.rs:1346. The PR does not touch that file, and the same command passes on currentmain.bcpack.rsandbcpack_bc2_tables.rsare clippy- and rustfmt-clean. Nit: with MSVC 19.50,runtime/test/bcpack_test.cpp:36raises C4244 at/W4becausestd::fillis called withint0xa5.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 on GitHub · 2026-12-02 18:01 UTC · original
Triage only: head
7078256d1conflicts with currentmain45dc41f95, and five CI jobs fail on that head. Not tested further.CI on
7078256d1(2026-11-30):stdlib-tests-linux,macos-python,check,semantic-tests (ubuntu-latest)andmacosallfailure. Thestdlib-tests-linuxlog fails intests/test_dstorage_multilevel_fit.py, for example: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) andtools/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 runpython -I scripts/check_no_game_data.pyon 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
@MoonEyes on GitHub · 2026-12-02 22:01 UTC · original
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:mainSHA it was merged onto;mainalone 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 on GitHub · 2026-12-03 07:02 UTC · original
VERIFY-2567 — 208 tests y 1289 subtests en verde en la PR de decodificación de BC1–BC7, y el
1118es el número que importa50 ficheros, +10 234: 8 en
runtime/, 13 entools/, 12 entests/, 2 end3d12/. Los tests de Python que toca, corridos en su árbol:Y
1118 subtestsen 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,#2807y#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 skippeddettpf_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 on GitHub · 2026-12-03 10:08 UTC · original
Estado de la rebasada, medido hoy: no es de las mecánicas, y mejor saberlo antes de empezar.
Y la diferencia entre las dos listas es la de siempre:
merge-treedice 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 deruntime/ytools/.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 elbcpack_testdel runtime compilado y ejecutado. Lo que no: si sigue en verde sobremainde 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 on GitHub · 2026-12-03 13:09 UTC · original
I rechecked the refreshed head
ea26edfbon Linux. It includesmainb053a181and also merges cleanly with #3271 (cfecc6ba).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 on GitHub · 2026-12-03 13:14 UTC · original
Rust throughput after the
ea26edfbrefresh. Following up on the earlier measurements, the refresh improves throughput over7078256din every codec I measured. It still delivers 24–32% less output per second thanmain(b053a181) on inputs all three builds decode correctly.b053a1817078256dea26edfbFigures are median MB of decoded BC output per second across six interleaved samples per build. I compiled the three
bcpack::decodeversions 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 becausemainlacks 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 on GitHub · 2026-12-03 13:45 UTC · original
RUN (RTX 3090 24 GB) — both exact-head candidate and main-only 300 s compatibility gates PASS.
ea26edfb15aa223a0e846b37d71ef6d6f3aa205econtains pinned mainb053a1813c8980c4357d51bbe6e69a35dc8c476c(merge no-op). Candidate exe SHA-256be2046d3c49a847445dd516ffbd27fd6d6db2c67600758ca1784296b64d18e4e; main8ddb36f22fd4c0883f3d633cb9317f40c26d5b24c73302115939554a8895d576. Both locked Rust 1.98.1, diagnostics,dlss,mimalloc.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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.