Performance recipe: cheaper hash for victory-gpu's maps, constant indirect light by default #15
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/paveledits--ScarlettMac!15
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-15"
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?
@jgrizon on GitHub · 2026-11-27 13:59 UTC · original
jgrizon:perf/fold-hasher→main· +630 −1 · 4 files · 2 commits · merged 2026-11-28 00:47 UTCChanges
Adds patch 0012 to the performance recipe. victory-gpu keeps about 19 hash maps keyed by its own addresses and slot numbers: twins, texture states, pending refreshes, bound pipelines, page-table views and so on. They used Rust's default hasher (SipHash), which protects against keys an attacker picks. These keys are addresses VIctory chooses, so that protection buys nothing. The patch switches those maps to the multiply-and-fold hash the descriptor census already uses.
There is no switch. The maps hold the same entries and give the same answers. Nothing depends on a map's iteration order; the one count that needs an order sorts its entries first.
A profile showed the submitting thread spending about 7 ms of each ~240 ms frame in SipHash.
Second patch: constant indirect light by default (0013)
play-main-mac.shnow setsVICTORY_AMBIENT=1.0instead ofestimate. WithVICTORY_HALVES_LOCAL, the title's compute BVH builder (XboxBvhBuilder.dll) never runs, so the probe resolve traces against nothing and anything the sun does not reach directly is near black. The estimate's floor (about 0.04) leaves 99 to 100% of points under it. The constant stand-in lights faces, skin and clothing, with some small dotted artifacts on skin. Details are in #17. ExportingVICTORY_AMBIENT=estimaterestores the old behavior.VICTORY_AMBIENT=estimate(old default)VICTORY_AMBIENT=1.0A diagnostics build gave 431 frames with
1.0and 386 withestimate. Single runs on this Mac vary between about 450 and 600 frames, so these numbers show no cost, not a speed gain.runtime-preview/build.sh --perf --prepare NEW_DIRapplies all 13 patches from a fresh directory (exit 0).Verification
Apple M5 Pro, 24 GB, macOS 27.3, CrossOver 26.3.0.39832, D3DMetal 3.0, patched CrossOver Wine from
tools/macos/build-crossover-wine.sh.runtime-preview/build.sh --perf --prepare NEW_DIRapplies all 12 patches from a fresh directory (exit 0).cargo check -p victory-gpu --target x86_64-pc-windows-gnullvmon that tree: clean.587 passed; 0 failed; 21 ignored.zsh -n scripts/build.sh && zsh -n scripts/run.sh && sh -n runtime-preview/build.sh: passed.play-main-mac.shsettings. World frames in the first 120 s:The gain is about 3%. Runs vary by 10% to 30%, so this is a small, steady gain, not a big one.
Not verified: all game runs above used the November 27 recipe (0001) plus this change, without upstream's newer patches 0003 to 0011. Those patches and this one touch different files and apply cleanly together, but no game run of the exact 12-patch series has finished yet.
@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-27 14:00 UTC · original · reviewed
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Performance recipe: cheaper hash for victory-gpu's address maps (+3%)to Performance recipe: cheaper hash for victory-gpu's maps, constant indirect light by default