Every ray a miss (VICTORY_RT_MISS=1), and ray-only passes left out by run-time names (port of edsuuu/VI-BR-PORT) #143
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/TaynanGT--Vice-Tay!143
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-143"
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?
@CowboyBingus on GitHub · 2026-11-27 04:13 UTC · original
CowboyBingus:perf/rt-miss→main· +197 −2 · 6 files · 5 commits · openWhat it does
Three switches, all off by default. With none of them set, nothing changes.
VICTORY_RT_MISS=1: the ray-tracing node test (image_bvh_intersect_ray/image_bvh64_intersect_ray) is emitted as a constant miss. A box node answers four absent children (bvh::NONE) and any other node the triangle-miss result (bvh::MISS). Only the value1turns it on. Forms of the instruction the translator already refuses are still refused. It is part of the translation: the shader cache's key getsVICTORY_RT_MISS=1added only when it is on (asVICTORY_PORT_CBVdoes), so translations cached without the switch keep their key, and a run with it on looks translations up under a different key.VICTORY_RT_SKIN_NAMES=<list>: compute programs whose container matches the list are left out. Meant for programs that only skin meshes for the ray-tracing structures.VICTORY_RT_TRACE_NAMES=<list>: the same, meant for programs that trace against the ray-tracing structures.Exact semantics of the two lists
VICTORY_RT_MISS=1andVICTORY_BVH_BUILDERis not1. Otherwise both lists are dropped and nothing is left out. Unset, empty, or not valid Unicode: nothing is left out.,. An entry is terms split by+; each term is a name that a compute program's container must hold, or, with a leading-, a name it must not hold. Whitespace around terms is trimmed. Matching is on exact bytes, case-sensitive, anywhere in the container. An entry with no name it must hold (only-terms, or none) is dropped.left_outpath ofcrates/victory-gpu/src/pipeline/make.rs(the one the ray-resolve and ray-activation programs already take without the builder): no host pipeline is made for it (ready,nowandearlyreturn without making it), so its direct and indirect dispatches find no host pipeline and are not run.Names come only from run-time text
Following
docs/asset-policy.md, this change adds no program names, hashes or other text from a title to the tree: its code, comments, tests and docs carry none. The names are given at run time in the two environment variables. The unit test uses made-up names.How to see that it engaged
With either list holding at least one entry, the log has, once, when the variables are read, a line ending in (info level, so in release and diagnostics builds):
on=truemeansVICTORY_RT_MISS=1was read and the builder is off. The 1st, 2nd, 4th, 8th, ... pipeline each list leaves out (counted per list, at pipeline creation) logs a line ending in:VICTORY_RT_MISS=1has no log line of its own; with it on, the shader cache key differs, so each shader is translated under the new key the first time it is needed with the switch on.Credit
Ported from edsuuu/VI-BR-PORT (GPL-3.0-or-later, as this repository), author edsuuu:
7d7b9e49"Shaders: VICTORY_RT_MISS=1 has the ray-tracing node test hit nothing": thevictory-shadercode (emit/intersect.rs, the switch's reader inemit/mod.rs) is taken from it; only the reader's doc comment is shortened.ab4571dfand1556de82(the skinning passes) and24f8d2ed(the tracing passes, and one more pass it counts with the skinning ones): the idea is ported; the code here is new.Differences from the source
VICTORY_RT_SKIN_NAMES/VICTORY_RT_TRACE_NAMESat run time, in the list form above.dispatchand inexecute_indirectindraw.rs; here the pipeline is left out when it is created (Pending::new→left_out), so the running title never translates or builds it either.VICTORY_RT_SKIN=1/VICTORY_RT_TRACE=1to run a kind anyway; here leaving the list unset does that.VICTORY_RT_MISS=and the variable's raw value (empty when unset) to the key on every run; hereVICTORY_RT_MISS=1is added only when the switch is on.rt_miss: the source's also describes what the picture and the card's time did in its runs; here it keeps what the code does and when to use it.Tests and checks
Run on the branch's code with toolchain 1.98.1 from
rust-toolchain.toml. Since these checks, onlydocs/this-fork.mdhas changed.cargo clippy --workspace --all-targets --locked -- -D warnings: cleancargo clippy --workspace --all-targets --all-features --locked -- -D warnings: cleancargo test --workspace --locked: 1107 passed, 0 failed, 53 ignored (includespolicy::tests::repository_passes_policy)cargo test --workspace --all-features --locked -- --test-threads=1: 1170 passed, 0 failed, 54 ignoredcargo build --locked --release -p victoryandcargo build --locked --profile diag -p victory --features diagnostics: builtNew unit test:
pipeline::make::tests::name_lists_match_held_and_absent_names(list parsing and matching, made-up names).Measured
Setup
cargo build --locked --release -p victory, exe md570ca0abbf02d175663c152c734dfe3b2).-Machine 4070, Series S. Each run was about 230 s of log time (229.6-230.1 s).VICTORY_RT_MISS=1and both name lists, with the texts passed at run time.VICTORY_AMBIENT_REFLECT, still open). No run setVICTORY_AMBIENT_REFLECT, and ray-miss was not run together with #99.Frame time
Medians over the log's frame lines that report more than 1,000 draws per frame (31 or 32 lines per run). "preparing" and "copying back" are that line's own ms-per-frame figures.
The mean of the off medians is 45.95 ms/frame, and of the on medians 42.92. Each on run was 2.35 to 3.75 ms/frame below the off run just before it.
Engagement
on=true skin_entries=2 trace_entries=2.pipeline left outlines for the skinning list (count 1, 2, 4, 8, 16) and 4 for the tracing list (count 1, 2, 4, 8).Picture, with the switches on
Known risk: corrupted patches on a character's face
These patches are multicolour blocks or green blotches on one character's face. The cause is not established, and the corruption also appears with none of the three switches set. We checked screenshots 104-118, part of the scene where that character is on screen.
skin_entries=1 trace_entries=3).VICTORY_RT_MISS=1alone (no lists, same build and settings): it appeared in 0 of 5.Recommendation
Keep all three switches off by default.
VICTORY_RT_MISSalone (no lists) may be the safer subset. In four alternating runs of the same build with only that switch (off, on, off, on; a screen recording ran from about 160 s to 175 s in each; in the second off run it captured another window), the medians were 45.2, 49.1, 50.45 and 47.7 ms: no consistent difference from off.🤖 Generated with Claude Code
Port of the idea of edsuuu/VI-BR-PORT commits ab4571df08 ("gpu: skip the ray-tracing skinning passes when every ray misses") and 1556de8203 ("gpu: know the ray-tracing skinning passes by their entry point"), author edsuuu, GPL-3.0-or-later. Those commits name the title's programs in code. Under docs/asset-policy.md the names come at run time here: VICTORY_RT_SKIN_NAMES is a list of entries split by ',', each entry terms split by '+' that a compute program's container must hold (a leading '-': must not hold). A pipeline whose compute program matches is left out through the existing left_out path of pipeline/make.rs (no host pipeline is made for it, so its dispatches find none and are not run) only while VICTORY_RT_MISS=1 and VICTORY_BVH_BUILDER is not 1. Unset or empty: nothing changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>Port of the idea of edsuuu/VI-BR-PORT commit 24f8d2ed48 ("gpu: leave out tracing against the ray structures when every ray misses"), author edsuuu, GPL-3.0-or-later. As with VICTORY_RT_SKIN_NAMES, the title's program names come at run time (docs/asset-policy.md), not from code: VICTORY_RT_TRACE_NAMES, same list form. Acts only while VICTORY_RT_MISS=1 and VICTORY_BVH_BUILDER is not 1. Unset or empty: nothing changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>@TaynanGT on GitHub · 2026-11-27 05:46 UTC · original
Thanks for keeping the controls opt-in, @CowboyBingus. I checked that the shader cache key separates the miss variant and that the name lists only select compute passes with the builder off. GitHub currently shows conflicts with
main. The cache key and emitted miss behaviour need to stay paired when the branch is reconciled.For the foliage report in #168, I’d keep this as a separate comparison once an affected recipe is identified. The name lists should target passes known to feed ray tracing so shared skinning work stays available.
0398c086ffto00acb3bd3a@CowboyBingus on GitHub · 2026-11-27 10:26 UTC · original · edited 2026-11-27 10:36 UTC
Thanks for the review. Rebased onto
main99a7f9b; the branch is now99a7f9b+1414057,c5941de,1d44973(code) +cc5d6b2,00acb3b(docs). Against the head you reviewed (0398c08),git range-diffshows code commits 1 and 3 identical and commit 2 changed only in context (its list check inleft_outnow followsmain'sVICTORY_SKIP_PIPELINEScheck); indocs/fork-ray-tracing.mdthe new section now follows the reflection-hold text frommain, which is kept. GitHub reports it mergeable.On the two points:
victory_shader::emit::rt_miss()(emit/mod.rs:224) is whatemit/intersect.rs:126branches on and whatshader_cache.rs:151keys on inbuild(). WithVICTORY_RT_MISSunset, no bytes are added to the key.ray_lists()(pipeline/make.rs:147) returns empty lists unlessVICTORY_RT_MISS=1andVICTORY_BVH_BUILDERis not1(line 156); with a list holding an entry but those conditions not met, the only effect is one info log line. Onlycomputestages are matched (line 179). No names are built in.Not covered, plainly:
intersect.rs.handle()setup and writes its results withoutbegin_guarded/end_guarded(each write still takes the lane guard,intersect.rs:136).VICTORY_BVH_BUILDER; only the name lists are.A/B (same session, interleaved, order A1 R1 A2 R2, 450 s each)
Setup: exe md5
B59ED46815DAAD639B969AB248C79ACE, thetarget\diagexe of the tree that was measured:main4ee1a47+ the same three code commits (git range-diffshows them identical to the rebased ones) + two docs commits; the exe was written after the code commits, and the tree's uncommitted state at build time is not recorded. diag profile with thediagnosticsfeature (target\diag; every run log has the diagnostics-only write-watch line);scripts\play.ps1 -Console series-s -Machine 4070 -Windowed -Dlss quality; reflection hold on in both arms (VICTORY_AMBIENT_REFLECT=1,VICTORY_AMBIENT_REFLECT_IN=CS_TemporalResolve2_Opaque,CS_TemporalResolve1_Alpha);VICTORY_KEYS_FILEset: in both arms a background job, started just before the launch script, wrote Enter presses (held 0.3 s) to it once its clock was past 35 s, beginning no new round after 62 s on its clock; each write first waited until the game had taken the previous file, and neither the write times nor when the game took each press are logged; a window capture after each 3 s wait while the game window was up (135-136 taken per run, not posted). RTX 5070 Ti 16 GB, Ryzen 7 9800X3D, 64 GB.Arm R adds
VICTORY_RT_MISS=1and the two lists,VICTORY_RT_SKIN_NAMESwith 1 entry andVICTORY_RT_TRACE_NAMESwith 3 entries (names given at run time). Both R logs reporton=true skin_entries=1 trace_entries=3and log left-out skinning and tracing pipelines.Lines: the frame-meter lines this build prints about every 5 s (not once a second), with > 1000 draws and 0 pipelines being made; medians over those (rounded half up: to 0.1, draws and dropped draws to whole numbers); p10/p90 by nearest rank. With fewer than 100 lines per run, the 1% low is the lowest line.
A2 has fewer lines used: 33 of its 86 lines had pipelines being made (21 of them with > 1000 draws); in A1, R1 and R2 that was 2, 1 and 7.
@TaynanGT on GitHub · 2026-11-27 10:37 UTC · original
@CowboyBingus The rebased
00acb3bpassed Windows CI. Both pairs show lower preparation time and roughly 100 more dropped draws per frame with the miss mode and lists enabled together. The next useful split is miss mode alone versus miss mode plus the selected lists, using the same warmed scene. That gives us a way to check which drawing work the lists remove before judging the FPS difference.@CowboyBingus on GitHub · 2026-11-27 11:43 UTC · original
The split you asked for in this comment: miss mode alone (M) and miss mode plus the lists (ML), interleaved M1 ML1 M2 ML2, 450 s each, run back to back.
Setup: as in my earlier comment, with two differences: window captures taken were 135, 127, 136 and 135 (M1, ML1, M2, ML2), and the exe (md5
9551D082D8A9B5DCF3ED830627721B47) is this PR's head00acb3bwith #206 (292adb5, the depth-plane change) merged locally. All four runs used the same exe. M setsVICTORY_RT_MISS=1; ML adds the same two lists as before (1 skinning entry, 3 tracing entries). Reflection hold on in all runs.Lines with > 1000 draws and 0 pipelines being made; medians rounded half up (draws and dropped draws to whole numbers); p10/p90 by nearest rank; with fewer than 100 lines per run, the 1% low is the lowest line.
Log: no missing-depth warning in any of the four runs. A
role=Resolvestand-in line is logged in M1, ML1 and ML2, not in M2. Both ML runs log the lists as on (on=true) and logpipeline left out:lines for the skinning and tracing lists; the M runs log neither. On the last per-reasondropped .../frame without a host pipelinelines of each run, the skinning list accounts for 95.3 (ML1) and 95.1 (ML2) per frame and the tracing list for 4.0 per frame in both; the M runs have no list entries there.Picture: at about 200, 330 and 440 s, the walls on both sides of the window are darker in M1 than in ML1, M2 and ML2, and M1's shots are framed slightly differently. I have not found why.
@TaynanGT on GitHub · 2026-11-27 11:50 UTC · original
@CowboyBingus The two rounds flip which arm is faster, while the lists consistently add about 95 skinning and four tracing drops per frame. I’ll keep the lists opt-in. The wall difference is worth a same-angle check with the miss mode alone, using the same cache state. The shared
role=Resolveline is useful when it appears, and the four runs had no missing-depth warnings.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.