[pr-fix][dlss][frame-generation][NVIDIA] Reflex markers: RENDER_SUBMIT_START carries the frame the lists were submitted in #283
Loading…
Reference in a new issue
No description provided.
Delete branch "iboom72/fix/reflex-submit-marker-frame"
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?
What it changes
crates/darner-gpu/src/streamline.rs,render_submit_begin, sincec88549fc).render_submit_begintakes the marker's frame id fromqueue::presented() + 1at the moment it is called. The line (queue::behind, on with the relay and thin lists, so in a default NVIDIA start) calls it when it runs a submission, and that can be after the title has presented the frame: the title may be one present ahead (DARNER_SUBMIT_FRAMES, 1 by default). Frame N's last submissions then setRENDER_SUBMIT_STARTfor frame N + 1, possibly before that frame'sSIMULATION_START, and N + 1's own first submission sets none, because the id only moves forward. The other markers of a frame already carry the title's frame: the simulation markers are set on the title's thread, andRENDER_SUBMIT_ENDand the present markers take the frame that goes with the present job.c88549fcchanged this id from the host's present count toqueue::presented() + 1so that all markers of a frame id are one title frame's. That holds where lists run at once and not where the line runs them later.What this does: the frame is read on the title's thread when the lists are submitted (
behind::submit) and goes with the job (Job::Lists,Job::Run,Job::Joined; a joined job keeps its first submission's frame).render_submit_begin(frame)takes it as an argument. The six callers inqueue.rsthat run lists at once passpresented() + 1, the value they got before.What it affects: NVIDIA's latency statistics (PCL) and the order of a frame's markers. Reflex's sleep is sent with
use_markers_to_optimize: false. Whether DLSS frame generation reads this marker is not known to me.How it was tested
c782a6e2cargo test -p darner-gpu --lib --locked queue::behind: passed (9 tests). They drive the line with a stand-in job, so they show only that the line still builds and orders as before, not the frame that goes with a job.cargo test -p darner-gpu --lib --locked streamline: passed (62 tests). None of them sets a marker.cargo clippy -p darner-gpu --all-targets --locked -- -D warnings: passed.cargo clippy --workspace --all-targets --locked -- -D warningsand the same with--all-features: both passed.cargo test --workspace --lockedwas not run as a whole. Only the two filters above were run ofdarner-gpu's tests.present_beginshas moved the marker's count to that frame by then. The held parts thatqueue.rsruns later without the line still read the count when they run, as before.Checklist
main.docs/asset-policy.md.Not run in the game: I have no way here to read the PCL markers a run sends.
Checked for overlap
c88549fcafter its review made the frame idqueue::presented() + 1). Open pull requests found that change the same files: #222, #168, #143, #48, #47 (streamline.rs) and #93 (queue/behind.rs); none of their diffs touchesrender_submit_beginor the line's jobs. None found forqueue.rs.🤖 Generated with Claude Code
Independent Windows build, gate, and code-read review of
c782a6e21(based onmainf3840d73d). Not run in-game or with live Reflex/PCL capture.Environment
x86_64-pc-windows-msvc), MSVC 19.44.35230.Measured results
cargo clippy --workspace --all-targets --locked -- -D warnings): PASScargo clippy --workspace --all-targets --all-features --locked -- -D warnings): PASScargo xtask policy: PASS (asset policy: 555 files ok)cargo test --locked -p darner-gpu --lib queue: PASS (63 passed; 0 failedin 1.21 s)cargo test --locked -p darner-gpu --lib streamline: PASS (62 passed; 0 failedin 0.04 s)Code-read audit
behind::submit(crates/darner-gpu/src/queue/behind.rs:1085-1108) capturespresented().wrapping_add(1)on the title thread at submission time and carries it throughJob::Lists,Job::unfold->jobs_of,Job::Run, andJob::Joined(preserving the first submission's frame intake_along), passing it tostreamline::render_submit_begin(frame)inJob::go.frame::wait(frame.rs:318),queue::present(queue.rs:1395-1398), andstreamline::present_begins(streamline.rs:3138).render_submit_beginremains guarded bypcl_active()and monotonicadvance_frame(&RENDER_SUBMIT_FRAME, frame).Job::Presentblockstake_along(behind.rs:808), soJob::Joinednever merges across a present boundary there; all 6 direct callers inqueue.rs(216, 224, 297, 507, 516, 889) passpresented().wrapping_add(1).Held::Runpath (queue.rs:507, 516) still readspresented() + 1at release time rather than enqueue time (same asmain).main): if a non-presenting queue runs a frameN + 1submission while the presenting queue is still blocked on frameN, monotonicRENDER_SUBMIT_FRAMEadvances toN + 1andpresent_begins(N)emitsRENDER_SUBMIT_END(N)withoutRENDER_SUBMIT_START(N).Verdict: PASS.
AI-assisted: yes (Gemini 4 Neon).
Follow-up to "How it was tested": the description says
cargo test --workspace --lockedwas not run as a whole. It has now been run, together with five other small pull requests of mine, on one local branch.mainf3840d73with these six commits picked on top, no conflicts:98a3c911(#265),5799f84a(#270),c782a6e2(#283),e69c0f77(#284),1c142d36(#285),5eae3d19(#286). Not run on this pull request's branch alone.cargo clippy --workspace --all-targets --locked -- -D warnings: passed.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed.cargo test --workspace --locked: one test failed, indarner-shader:emit::waterfall_tests::sampled_marks_restore_early_depth_only_when_safe_in_pixel_shaders("DXIL validation failed ... Not all elements of output SV_Depth were written"). The same test fails the same way onmainf3840d73without these commits, none of the six changesdarner-shader, and #227 (open) fixes it.darner-shader's other tests: 557 passed, 16 ignored.cargo test --workspace --locked --no-fail-fast --exclude darner-shader: passed, all packages and the doc tests (darner-gpu: 1,773 passed, 81 ignored).Still not run in the game.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.