Performance recipe: run the title's BVH builder for correct lighting #20
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!20
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-20"
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 18:57 UTC · original
jgrizon:perf/bvh-builder→main· +3589 −2 · 21 files · 3 commits · merged 2026-11-28 00:47 UTCSummary
This PR builds on #15: it contains #15's two commits plus one new one. Merge #15 first, or take this PR alone.
The new commit adds patches 0014 to 0029 to
perf/patches/series:VICTORY_BUILDER_EXACT. A translation records whether its 32-lane halves are exact, and the builder opens only when they are. It is off by default.play-main-mac.shsetsVICTORY_WAVE64_REDUCE=1,VICTORY_BUILDER_EXACT=1andVICTORY_AMBIENT=0. This replaces #15'sVICTORY_AMBIENT=1.0default.Why
The constant stand-in from #15 made faces visible but flat, and dropped draws stayed at about 1,400 a frame. Nearly all of them were "dispatch: the BVH builder held back". The builder was held back because it was run in 32-lane halves while its programs exchange data across the halves; upstream VIctory PR #2711 found that run this way it hung an RTX 4070 SUPER within two minutes. With exact wave64 reductions and lane reads, every one of its programs translates exactly, so the builder can run. I rejected the alternative, estimating the light (
VICTORY_AMBIENT=estimatewith or withoutFLOOR): faces stayed black.Evidence
Hardware: Apple M5 Pro, 24 GB, macOS 27.3, CrossOver 26.3.0.39832 with patched Wine, D3DMetal 3.0. Series S intro, release builds, same launcher switches otherwise.
VICTORY_AMBIENT=1.0)BVH builder runs ... 53 made, 0 refused. No GPU hang in any run, the longest 10 minutes../build.sh --perf --prepare DIRon a clean directory: the whole series applies. The prepared tree is identical to the tree I benchmarked, except for the 0002 display-name patch.592 passed, 0 failed, 22 ignored. victory-hle166 passed, 1 failed; the failure is the existing xpackage function-pointer test, which fails without these patches too.Not tested: D3DMetal 4.0 beta 3, other Macs, and anything past the intro.
Risk
Can we undo it? Yes, easily.
What could break: the frame rate drops about 15% with the new default. A GPU hang is possible on hardware where the builder's programs do not translate exactly. The builder stays held back in that case, which gives the old black faces rather than a hang.
How to undo: export
VICTORY_WAVE64_REDUCE=0 VICTORY_BUILDER_EXACT=0 VICTORY_AMBIENT=1.0, or drop patch 0029 from the series.VICTORY_WAVE64_REDUCE=1without the builder leaves green speckles, so turn the two off together.Also tried and not adopted: lighting the builder only every 3rd or 4th frame (
VICTORY_BUILDER_EVERY), andVICTORY_FLIGHTS_RANGES. Neither gained anything over run-to-run noise.Panel
Not run.
@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-27 18:57 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.