WIP: [pr-performance][shaders][NVIDIA] DARNER_FLOAT_FAST: plain float forms instead of exact RDNA emulation on non-AMD hosts (opt-in) #295
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!295
Loading…
Reference in a new issue
No description provided.
Delete branch "groster17800/Darner:pr/float-fast"
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?
Contributor role (optional)
What it changes
Not yet measured on this revision in the game: the A/B below is pending (two runs on this exact build). This is a draft until it is in.
DARNER_FLOAT_FAST=<bits>(off by default): on non-AMD hosts the translator emits the plain float form for the RDNA ops named by the bits instead of the exact emulation. Bit 16 makesv_mul_legacy_f32/v_mad_legacy_f32plain products. The value is in the shader cache key (throughhost_rdna), so changing it rebuilds the pipelines once.#76's
DARNER_LEGACY_FINITEdoes a related thing on AMD only (it is read only in the AMD form of the legacy multiply); this is the NVIDIA/Intel side.The idea and the original code are mrp1no's (mrp1no/victory-3060, GPL-3.0, commits 17a5251d and 7db51edb); this is a port to Darner's translator, with mrp1no as co-author of the commit.
How it was tested
Tested revision:
d53d435(on mainf3840d7)Commands and results: gate 1
cargo clippy --workspace --all-targets --locked -- -D warnings: clean. Gate 2, the same with--all-features: clean. Gate 3cargo test --workspace --locked: 3,344 passed, 2 failed, 121 ignored; neither failure comes from this change:emit::waterfall_tests::sampled_marks_restore_early_depth_only_when_safe_in_pixel_shadersfails the same way on mainf3840d7(also noted in #164), andwatch::tests::ask_once_by_res_splits_reservations_without_refusalsfailed once in the full parallel run and passes on its own, 3 of 3 on this branch and 3 of 3 on main (also noted in #52 and #164).Changes a default: no
A/B result: pending. Plan: this build, RTX 3060, Series X, DLSS Balanced, RT off, no FG, play's defaults otherwise, standing 4 min at one spot; A without the variable, B with
DARNER_FLOAT_FAST=23, each after its ownpreload --used.Earlier, not on this revision and not this change alone: on a Darner build of 2026-12-02 (v2026.12.02.01 + this change + one other opt-in switch,
AMBIENT_LEAN), Series S + DLSS Quality, Jason's balcony, two runs: both off, thenDARNER_FLOAT_FAST=23andAMBIENT_LEAN=7together: card meter 55.2 → 45.2 ms (−18 %), frame median 69.6 → 61.0 ms. The A/B above will give this change's own share.Gates run on that revision: all three (results above).
Gameplay: RTX 3060 12 GB (driver 621.47), Ryzen 7 5700X, 32 GB RAM, Windows 11, Resizable BAR on; with
DARNER_FLOAT_FAST=23in every run since 2026-12-02 (Series S and Series X, DLSS, RT off).Shader wave sizes tested: 32 lanes (NVIDIA).
Hardware dependence: any non-AMD host; untested on Intel.
Coverage gaps: a shader relying on the exact legacy rule (0 × inf = 0) may show NaN or black pixels with bit 16; none seen with
23in several hours of play (water, skin, lights, city). Not tested with ray tracing on.Checklist
main.docs/asset-policy.md.Checked for overlap
🤖 Generated with Claude Code
One compatibility edge in
d53d435: the AMD option still defaults toEXACT_ALL, but its accepted mask is nowALL. That lets an explicitDARNER_RDNA_FLOAT=16select the new plain legacy multiply on AMD. Main masks that bit out;0x1fsimilarly used to resolve to15and now resolves to31.The one-line follow-up restricts the accepted AMD bits to
EXACT_ALL. Fresh-process fixtures covered unset,0,16,0x1fand an invalid value. The old AMD results were restored, andDARNER_FLOAT_FASTstill accepts the additional bit on the non-AMD parsing path. The focused shader check and asset policy passed.Thanks, you're right: main masked
DARNER_RDNA_FLOATto 15 and this widened it to 31, so an explicit value on AMD could pick up bit 16. I've taken your commit as it is (b64e6b0, your authorship kept) into the branch:DARNER_RDNA_FLOATis back toEXACT_ALLfor both the default and the accepted bits, and bit 16 stays withDARNER_FLOAT_FASTon other hosts.I haven't re-run the gates on
b64e6b0yet (no power here for a few hours); I'll add the results to the description when I have them.Tried
b64e6b0on top of mainf3840d7with #334, #337, #274, #397, #312 and #304. It conflicts with #304 inhost_rdna; I kept #304's host-neutral bits and OR-edfloat_fast()on top. RTX 4080 16 GB (driver 621.40), i7-13700K, Series X profile, 1440p DLSS Quality, frame generation off, hardware ray tracing on.DARNER_FLOAT_FAST=23: 34 fps against 33 for the same build without #312, #304 and this (card time in the title's lists 23.5 against 25.9 ms a frame; one run each, same manual route). But indoor scenes and cutscenes came out over-exposed, close to white; outdoors looked right.DARNER_FLOAT_FAST=7: lighting broken in dark scenes (a 36-minute run through the opening, 30 fps median).So on this card neither value is usable as it is. The card-time gain in the first run also includes #312 and #304, added in the same step.
Thanks @MesoPlz for the run. I measured this revision too, and I'm closing this PR.
RTX 3060 12 GB (driver 621.47), Ryzen 7 5700X, Windows 11, Resizable BAR on. Build: this branch as it is (
b64e6b0on mainf3840d7), release. Series X, 2560×1440 output, DLSS Balanced (preset K), no frame generation, ray tracing off, play's defaults otherwise, each side after its ownpreload --used. Jason's balcony, standing. Card time is the card meter's "title's lists" median.DARNER_FLOAT_FAST=23(40 s)So about -6.5 ms of card time a frame (-10 %), from one run each, B's window only 40 s long.
Picture, ray tracing off: inside Jason's house the white speckle and blown-out surfaces of #206 / #207 are there without the variable too (door, bed, curtains), but with
=23they are clearly stronger: the door glows almost white and the bed is washed out. That matches the over-exposure reported above, so it is not only a ray-tracing interaction.Since #304 now gives every card the safe part (the legacy products' short form,
DARNER_RDNA_FLOAT=2), what is left here is exactly the part that changes the picture. I'm closing it rather than rebasing; if someone wants to go after the remaining time, finding which of MAX_MIN, MED3, FRACT or the plain legacy product brightens the interiors would be the place to start.iBooM72 referenced this pull request2026-12-05 21:54:34 +00:00
Pull request closed