BCPack: find a slot's bucket from a window table #93
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!93
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/93/head"
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?
@TG0000 on GitHub · 2026-11-24 00:24 UTC · original
TG0000:perf/bcpack-bucket-lookup→main· +223 −28 · 1 files · 1 commits · merged 2026-11-24 08:47 UTCThe BCPack decoder (
crates/victory-formats/src/bcpack.rs, the DirectStorage texture unpack path) spends almost all of its time inLane::step, one rANS symbol at a time. This PR makes the per-symbol work cheaper. The output stays the same.What changes
Tablesnow keeps one byte per 256-slot window per model (32 KiB, boxed, built inTables::parse): the bucket of the window's first slot.bucket_ofstarts there and steps over the few buckets that begin inside the window.startgets one more 65536 sentinel, so the step loop needs no length check.leading_zeros, a multiply, a mask).pos / per * stride + pos % per(a division by a runtime value) for every symbol.Measured
Synthetic streams with the synthetic test tables. No game data. Release build, one core, 16384 blocks, median of 3 runs, before and after on the same machine:
To reproduce:
cargo test --release -p victory-formats bcpack_throughput -- --ignored --nocaptureTests
bucket_lookup_matches_a_scan_of_the_starts: the window lookup against the old scan, for every slot of every model, on the shipped tables, on the uniform synthetic tables and on tables with one-slot buckets.payload_step_matches_the_reference_decode: a payloadLane::stepagainst the first version's arithmetic (scan plus division), on the shipped tables and the synthetic ones, for every model and slot at three state heights.every_layout_round_trips_through_the_lanes: all six format lane layouts at 1, 2, 17, 300 and 1000 blocks, with short and long fragments.bcpack_throughput(ignored): the benchmark above.What ran:
cargo test --workspaceandcargo xtask policypass, andclippy --workspace --all-targetsreports nothing new. I didn't run the ignoredreference_chunkstest, because it needs reference chunks from outside the repository. This is CPU-only code, so it wasn't run on a GPU or against the game.It touches only
bcpack.rs, which no open PR touches.AI-assisted (Claude Code).
🤖 Generated with Claude Code
github-bot referenced this pull request2026-11-26 04:13:33 +00:00
@DaviTostes on GitHub · 2026-11-24 01:12 UTC · original
Tested
3e982f7: pass.cargo test -p victory-formats: 20 passed, 0 failed, 4 ignored, including the 4 tests this PR adds.No game data used.