Three pointers from the sibling forks: fxceless's submission-thread work, rdna::LEGACY on NVIDIA, an LLVM pass over the DXIL #66
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#66
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@marekpastuszczak-lang on GitHub · 2026-11-26 21:28 UTC · original
Not a report of a problem, so the template does not fit: three pointers from reading this tree next to fxceless/victory-fork and avatarmanz/VIctory-7900XTX. Nothing here was run in the game on my side; where a number is a measurement it says whose and of what.
1. Submission-thread work in fxceless that is not here
This tree comes from avatarmanz's, which left fxceless at
a26859f(2026-11-25). Since then fxceless landed three things that are frame time on the thread that prepares submissions, and I could not find them here under any name (heap_worker,lookup_cache):VICTORY_HEAP_WORKER=1(crates/victory-gpu/src/heap_worker.rs, needsVICTORY_LATE_WAIT): textures picked by index are uploaded and detiled on a thread of their own. Their runs 311 to 316: the first boat mission from 6.2-6.7 to 8.65, 9.50 and 9.53 frames a second.VICTORY_LOOKUP_CACHE=1(shadow.rs, their pull request 1237): about 14 ms a frame there, off by default on their side.e4245f3): -10 ms a frame there.Your panel shows the card at 87% in the boat scene, so the processor side is probably still part of the 21 fps.
2.
rdna::LEGACYon an NVIDIA cardThe cheaper
legacy_mul(emit/lower.rs, first branch) only runs whereset_host_rdnais true, that is an AMD card with waves of 32 and 64. The reasoning in it (a product is not 0 only where one factor is 0 and the other an infinity or no number) does not look specific to AMD. In a census of the archive on a build without it (fxceless085ee7c, 25,635 programs) compares of a float against zero were 6.7% of all host instructions and the whole legacy pattern an estimated 12 to 15%. avatarmanz measured the saving at 0.4 ms of 18.4 on an RX 7900 XTX, so it is small in card time there; on the RTX 4090 it is not measured at all as far as I can see.3. An LLVM pass over the finished DXIL module
The passes in
emit/bitcode/opt.rsare the only optimiser. I fed 400 translated modules from a shader cache (the same fxceless build) to DXC'sIDxcOptimizer(dxcompiler.dll1.8.2502 from the Windows SDK) and counted instructions from the disassembly:-instcombine -gvn -adce -simplifycfggives -9.3%, a wider set ending in-strip-dead-prototypes-11.2%, at 0.03 to 0.07 s a shader. The gain is in bitcast, select, shifts and branches.dxil.dll's validator accepts 386 of the 400 after the passes against 388 of 400 as translated; the two new refusals are "Flags must match usage", so the shader flags would have to be recomputed. The card's time with it is not measured.The same notes with more detail are filed at avatarmanz and fxceless: https://github.com/avatarmanz/VIctory-7900XTX/issues/382, https://github.com/fxceless/victory-fork/issues/1383.
@TaynanGT on GitHub · 2026-11-26 22:33 UTC · original
Thanks for checking the sibling forks against the source. Vice-Tay already caches registered buffer lookups and runs card hashing in groups. The texture worker moves the heap walk and upload-list preparation as well. I’ll check those costs and make sure a reused slot can’t publish an older upload.
The legacy multiply needs output checks for signed zero and subnormals on NVIDIA. Could you share the two shader hashes and validator messages from the DXIL optimizer failures? I’d like to retest those exact inputs and pass order.
@TaynanGT on GitHub · 2026-11-27 01:31 UTC · original
I checked the texture worker against Vice-Tay
mainatcc9ed86. The heap walk and upload recording still run on the recording thread here. The fxceless worker requires the late-submission path. Vice-Tay already has that path enabled throughVICTORY_RELAY=2inplay.ps1.The worker queues the upload ahead of the title’s lists and checks the slot’s descriptor generation before publishing.
mirror()reads the descriptor again, so a useful regression test would replace the slot between those reads and assert that only the view with a matching queued upload can be published. Worker gate and queue · Slot checkFor an RTX 4090 A/B, I’d use the same build, warm cache, Series S boat checkpoint and late-wait mode in both runs, with only the worker toggled. I’d compare median and p90 frame times, heap-pass and detiling time, and textures uploaded by the first bake. I’d also check the same checkpoint for missing textures. I haven’t measured the worker on the 4090 yet.
@marekpastuszczak-lang on GitHub · 2026-11-27 06:40 UTC · original
Here are the two, re-run on the same sample (400 entries, the same seed). Both fail the same way with either pass set, and the cause is one thing.
-instcombine -gvn -adce -simplifycfg)de2741054ae2471a177d2c4b1cdf19f95709081ce697d6cdc10cdb963efa9faeerror: Flags must match usage.note: Flags declared=1074790400, actual=10737418245bb53a59f4d2cc7f644fd38aa38d6af18fe0de2426b5804928c394711c6a00d2error: Flags must match usage.note: Flags declared=1075314704, actual=1074266128In both the difference is the one bit
0x100000, the 64-bit integer flag. Before the passes the modules usei64only for address arithmetic of this shape:and
-instcombinenarrows all of it toi32(26 and 12 lines withi64before, none after apart from the data layout line), so the flag the translator set (flags::INT64) no longer matches. So it is not a wrong result: the flags need to be recomputed from the module after the passes, or that one bit dropped when noi64instruction is left. With that the count would be 388 of 400, the same as the modules as translated.The names are cache keys of fxceless build
085ee7cwith its default translator settings, so they will not be found in a cache of yours; the entry does not carry the guest shader's hash and I did not map them back. Any shader whose only 64-bit use is that address arithmetic should reproduce it.For completeness, the 12 of 400 the validator refuses already as translated, untouched by any pass (so not from the optimiser): "vertex plus primitive output size is greater than 32768" (4), "signature element ... has interpolation mode that differs from another element packed into the same row" (5), "Container part 'Program Input/Output Signature' does not match expected for module" (3). The driver takes them, but they are there if you want them.
Tools:
dxcompiler.dllanddxil.dll1.8.2502.11 from the Windows SDK 10.0.26100,IDxcOptimizer::RunOptimizeron the bitcode alone, the result put back into the container's DXIL part and the whole container given toIDxcValidator. The wider set was-sroa -early-cse -simplifycfg -instcombine -reassociate -sccp -jump-threading -correlated-propagation -simplifycfg -instcombine -licm -gvn -dse -bdce -adce -simplifycfg -instcombine -strip-dead-prototypes.@TaynanGT on GitHub · 2026-11-27 06:49 UTC · original
@marekpastuszczak-lang The matching
0x100000difference on both entries is the useful result. Vice-Tay already checks module usage and clears unused feature flags after its internal optimisation passes, before writing the container. The external DXC pass runs after that point, so it would need to regenerate the flags from the optimised module and validate the resulting container before replacing anything. Your 12 baseline refusals give us separate fixtures to track by validator error.