Fix BC7 reference oracle dictionary index ordering #3263

Closed
github-bot wants to merge 1 commit from github-bot/gh-3263 into main AGit
Owner

@⁠edge2labs on GitHub · 2026-11-29 21:08 UTC · original
edge2labs:edge2labs/fix-bc7-oracle → main · +29 −3 · 1 files · 1 commits · closed without merging

Summary

Synchronize the BC7 reference oracle with the production decoder following commit f9de61c5.

The reference implementation was still skipping the word immediately after the index widths, causing three oracle parity tests to fail.

Changes

  • Correct reference dictionary index ordering.
  • Add a synthetic regression test covering all 32 dictionary words.
  • Preserve production decoder behavior.
  • No new dependencies or game assets.

Validation

  • Debug tests: 84 passed, 0 failed, 7 ignored.
  • Release tests: 84 passed, 0 failed, 7 ignored.
  • Strict victory-formats Clippy: PASS.
  • Staged asset policy: PASS.
  • Git diff check: PASS.

Performance impact

No direct runtime performance change. This fix restores the reliability of the regression tests required to validate future BCPack performance optimizations.

Known upstream issues

The baseline commit f72cec77 has unrelated workspace Clippy and repository-wide asset policy failures.

Tested on Windows with Rust 1.98.1.

Contribution by Edge2Labs.

**@⁠edge2labs** on GitHub · 2026-11-29 21:08 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3263) `edge2labs:edge2labs/fix-bc7-oracle` → `main` · +29 −3 · 1 files · 1 commits · closed without merging ## Summary Synchronize the BC7 reference oracle with the production decoder following commit `f9de61c5`. The reference implementation was still skipping the word immediately after the index widths, causing three oracle parity tests to fail. ## Changes - Correct reference dictionary index ordering. - Add a synthetic regression test covering all 32 dictionary words. - Preserve production decoder behavior. - No new dependencies or game assets. ## Validation - Debug tests: 84 passed, 0 failed, 7 ignored. - Release tests: 84 passed, 0 failed, 7 ignored. - Strict victory-formats Clippy: PASS. - Staged asset policy: PASS. - Git diff check: PASS. ## Performance impact No direct runtime performance change. This fix restores the reliability of the regression tests required to validate future BCPack performance optimizations. ## Known upstream issues The baseline commit `f72cec77` has unrelated workspace Clippy and repository-wide asset policy failures. Tested on Windows with Rust 1.98.1. Contribution by Edge2Labs.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 21:10:04 +00:00
Author
Owner

@⁠edge2labs on GitHub · 2026-11-30 00:14 UTC · original

I've completed an integrated performance contribution under Edge2Labs, consisting of seven commits rebased onto v2026.11.29.05 (41adb551).

The synthetic benchmarks on my i9-14900K, RTX 4080 SUPER and 64 GB RAM produced the following results:

  • 99.39% reduction in typical peak staging allocation latency.
  • 90.17% reduction in accumulated staging allocation time.
  • Up to 91.17% reduction in mapped texture memory query time.
  • Up to 83% reduction in GPU pool selection time.
  • Approximately 27% reduction in plain descriptor allocation benchmark time.
  • 1.26% reduction in BC6H decoding time.
  • Fixed three failing BC7 reference parity tests.

Both Release and Diagnostics builds succeeded. The two higher-risk runtime optimizations remain opt-in.

I also compared the contribution against an unchanged upstream checkout. Several existing test failures and Clippy errors are reproducible upstream, while some GPU tests appear sensitive to concurrent execution.

One remaining concern before submission: cargo xtask policy reports an existing violation in crates/victory-loader/src/heap_sites/frame_users.rs on both upstream and our branch. None of our changes touch this file. Could you clarify how you would like contributors to proceed?

I'd like to submit the integrated contribution for review under the pr-performance label and, if possible, have it benchmarked in-game against upstream, particularly without frame generation.

My main objective is to help achieve stable native 60 FPS or higher. I have not yet measured actual in-game FPS, so the reported improvements are strictly synthetic benchmark results.

**@⁠edge2labs** on GitHub · 2026-11-30 00:14 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3263#issuecomment-7265090740) I've completed an integrated performance contribution under Edge2Labs, consisting of seven commits rebased onto v2026.11.29.05 (41adb551). The synthetic benchmarks on my i9-14900K, RTX 4080 SUPER and 64 GB RAM produced the following results: - 99.39% reduction in typical peak staging allocation latency. - 90.17% reduction in accumulated staging allocation time. - Up to 91.17% reduction in mapped texture memory query time. - Up to 83% reduction in GPU pool selection time. - Approximately 27% reduction in plain descriptor allocation benchmark time. - 1.26% reduction in BC6H decoding time. - Fixed three failing BC7 reference parity tests. Both Release and Diagnostics builds succeeded. The two higher-risk runtime optimizations remain opt-in. I also compared the contribution against an unchanged upstream checkout. Several existing test failures and Clippy errors are reproducible upstream, while some GPU tests appear sensitive to concurrent execution. One remaining concern before submission: `cargo xtask policy` reports an existing violation in `crates/victory-loader/src/heap_sites/frame_users.rs` on both upstream and our branch. None of our changes touch this file. Could you clarify how you would like contributors to proceed? I'd like to submit the integrated contribution for review under the pr-performance label and, if possible, have it benchmarked in-game against upstream, particularly without frame generation. My main objective is to help achieve stable native 60 FPS or higher. I have not yet measured actual in-game FPS, so the reported improvements are strictly synthetic benchmark results.
Author
Owner

@⁠RochDawid on GitHub · 2026-12-01 01:32 UTC · original

main already has this change. be0ba3b7 ("bcpack: the BC7 oracle reads the dictionary as Microsoft's decoder does") makes the same edit to RefTables::parse: no skipped word after the widths, and all 32 index slots read. It reached main with the merge of #2565 (ac6b767d, 2026-11-29) and is in every release since v2026.11.30.01.

On main at f5c3d243, cargo test --locked -p victory-formats --lib oracle_parity gives 4 passed, 0 failed (oracle_parity_all_bc7_modes_rotations_subsets, oracle_parity_errors_and_noise, oracle_parity_all_formats_and_strip_boundaries, oracle_parity_all_bc6_modes). I ran it on a macOS host with Rust 1.98.1, not on Windows.

This pull request now conflicts with main. The only part main lacks is the new bc7_oracle_dictionary_word_order test; the oracle change itself is already there. #2236, #2419 and #3263 all make this same change.

**@⁠RochDawid** on GitHub · 2026-12-01 01:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3263#issuecomment-7297622935) `main` already has this change. be0ba3b7 ("bcpack: the BC7 oracle reads the dictionary as Microsoft's decoder does") makes the same edit to `RefTables::parse`: no skipped word after the widths, and all 32 index slots read. It reached `main` with the merge of #2565 (ac6b767d, 2026-11-29) and is in every release since v2026.11.30.01. On `main` at f5c3d243, `cargo test --locked -p victory-formats --lib oracle_parity` gives 4 passed, 0 failed (`oracle_parity_all_bc7_modes_rotations_subsets`, `oracle_parity_errors_and_noise`, `oracle_parity_all_formats_and_strip_boundaries`, `oracle_parity_all_bc6_modes`). I ran it on a macOS host with Rust 1.98.1, not on Windows. This pull request now conflicts with `main`. The only part `main` lacks is the new `bc7_oracle_dictionary_word_order` test; the oracle change itself is already there. #2236, #2419 and #3263 all make this same change.
github-bot closed this pull request 2026-12-01 18:58:57 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3263
No description provided.