fix(vk): the lean draw path reads the Upscaler row as it runs #3251
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3251
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/lean-draw-temporal-row"
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?
Summary
test_dlssgfails onmain: "vk_draw.cpp reads the Upscaler row's setting: what runs is vk_temporal.h temporal_row". #3048's lean draw path (RX_VK_DRAW_OVERHEAD_LEAN) readsopts.dlssindraw(), the Upscaler row as set. The check asks the renderer to read it as it runs, throughtemporal_row(), since with Streamline's loader an Upscaler change can wait for a restart.draw()now readstemporal_row()once per draw and uses it in those seven places. Nothing runs differently:temporal_row()isopts.dlss.temporal_note_scene_needed,fsr3_note_scene_needed,skin_check_needed) is already true from its env flag (kEnvTemporalOrFg,kEnvFsr3Inputs:dlssg_loaded()).This was in MagicBeanDev/Longshot#3248 (main's failing game-free checks), which is tests and lints only now. BeanBot's review there asked for the per-draw cost to be measured (L1); the measurement is below.
Read:
gpu/vk/vk_draw.cppdraw().To see it on
main:mise run test -- --exact tests/test_dlssg.py.Testing
Tested: Windows 11 (build 26300), RTX 5080, NVIDIA 621.47.
test_dlssg: fails onmain7bc53f841, passes here.dev.py smokefromkokiri-start. It reached play and ran 900 frames with the lean draw path on (its default, 1), so the changed lines ran every draw. The Insert menu opened, and there was no fault in the log. PASS. The run was on #3248's branch, where the game's only other change is the settings table becoming astatic.vk_draw.cppon Linux: compiled syntax-only with WSL's g++ (Ubuntu 24.04), with the renderer's Linux flags (host/posix,-D_GNU_SOURCE,-fPIC): no error.Still to test:
dev.py ab --scene market, expecting fps and 1% lows within the runs' spread, as on Windows (@Beanstalk, or by hand)Measurements
Verdict: no difference shown: +3.2% fps (median 115.1 against 111.6), within the runs' spread (A 101.9 to 113.9, B 109.7 to 122.3).
Setup: Windows 11 (build 26300), RTX 5080, NVIDIA 621.47; Market, child (crowded: the most draws) (window 1280x720); quality preset Custom, resolution 67%, output res 1920x1080 (native), frame generation Off, vsync Off; uncapped (HOS_FPS_MAX=1000); the frame trace, 60 s each after a warm-up until no frame waited for a pipeline, 3 interleaved pairs through the timing queue, the median;
dev.py ab --scene market. B was #3248's head (8f3173e1), whose only other change the game runs is the settings table as astaticinstead of aconst(no reader by value).7bc53f84be63688b(measured as #3248@8f3173e1, the same vk_draw.cpp)Spread: observed fps ranges: A 101.9 to 113.9; B 109.7 to 122.3. These ranges do not predict what another run will show.
dev.py abwrote no write-up at first. The runs'vk: switches setlines differ inLONGSHOT_BUILDER_PIPESandLONGSHOT_CRASH_BLOCK: Windows handle numbers the builder gives each game, which differ between two runs of the same side too (A1 against A2). This write-up isab.py's ownsummariseandmeasurementsover the same six runs with those two allowed, as--allowwould have done.Risks
None expected: the same values reach the same helpers. The cost is one
temporal_row()call per draw (dlssg_upscaler: one relaxed atomic load without Streamline); none shows in the Market. A revert is enough.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in game: Windows 11 (build 26300), RTX 5080, NVIDIA 621.47: dev.py smoke from kokiri-start (Kokiri Forest, Link's house) on a runtime with this change (built on #3248's branch, where the game's only other change is the settings table as a static): in play, 900 frames with RX_VK_DRAW_OVERHEAD_LEAN's default (1) running the changed draw() path every draw, the Insert menu opened, no fault in the log. PASS. And the Market A/B in Measurements.
Possibly related, for context:
@review
Recommendation: Approve. The code is ready: only testing is left. The change makes the draw path use the running Upscaler row, but its per-draw cost has not yet been checked on Linux or Steam Deck. CI is also still running. Recommend approval; not approved on the forge.
The lean draw path reads the effective Upscaler setting through temporal_row() instead of reading the saved setting directly. The reported helper inputs remain equivalent, at the cost of an additional call on each draw.
Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_draw.cpp:11039: The additional call is on the per-draw path, and its cost on Linux and Steam Deck has not been measured. (more on the line) Do: Run interleaved base and PR measurements in a draw-heavy scene on Linux or Steam Deck, including FPS, 1% lows and frame times.Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven as a player-facing fix: the existing source check fails on the base and passes with this change, but the PR says the helper decisions do not change. On Windows RTX 5080, median FPS was 111.6 before and 115.1 after across three interleaved pairs; the ranges overlap, so these runs do not establish a performance difference.
Other systems: The call runs on the draw path on Windows and Linux, including when the lean path is disabled. With Streamline loaded, dlssg_upscaler may also store the row; without Streamline it returns the supplied row. The reported game run covers Windows on NVIDIA; Linux and Steam Deck remain untested.
Switches: None added, changed or removed. The existing RX_VK_DRAW_OVERHEAD_LEAN defaults to 1.
Reviewed:
be63688b05against7bc53f8413: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, the diff and commit, draw_overhead_lean.h, and the relevant temporal and Streamline implementations and source check. Reviewed the changed portions of gpu/vk/vk_draw.cpp and their surrounding draw path; the full 15,644-line file was not read. The requested review checklist and adjacent Tooling checkout were absent. No generated files or recorded runs changed.; nothing run (a code review).Checked and fine:
Testing: No commands from the project were run, as requested. The author reports a Windows game smoke run, a Linux syntax-only compile, and three interleaved Windows measurement pairs; CI is still running.
Overlaps and merge order: PR #3248 formerly included this change and is described as tests and lints only now.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -11036,2 +11036,4 @@(getenv("RX_VK_FSR_FG") && atoi(getenv("RX_VK_FSR_FG")) > 0) ||dlssg_loaded();// (the Upscaler row as it runs, vk_temporal.h: with Streamline's loader the row can wait for a restart)const int upscaler_row = temporal_row();L1 (should fix): The additional call is on the per-draw path, and its cost on Linux and Steam Deck has not been measured.
When: A draw-heavy scene on AMD RADV now calls temporal_row() for each draw; the Windows NVIDIA measurements do not show its effect on that platform.
Do: Run interleaved base and PR measurements in a draw-heavy scene on Linux or Steam Deck, including FPS, 1% lows and frame times.
@Beanstalk
Beanstalk test farm · 🔄 testing (0 of 6 reports so far)
Commit
be63688· approved by llun (reviewed) · dashboard⚠️ Note: The farm does not run the game-free source check, so this plan cannot establish that test_dlssg passes.
⚠️ Note: The default build does not exercise the Streamline-loaded restart-dependent path; this plan measures the ordinary per-draw path instead.
Done (started 13:50 UTC). Comment
@Beanstalkto run it again.nvidiaamdintellinux+radvsteamdeckwindows+nvidiaWhat was tested
What will be tested · AI plan (
gpt-6.1-terra)Compare main and the pull request over three alternating starts per side in the crowded Market and Kokiri Forest, including Linux RADV and Steam Deck. Each location gets a 60-second uncapped measurement at 720p to emphasize per-draw CPU cost, plus a still screenshot. The plan measures FPS, frame-time median and 1% lows; crashes, screenshot differences above 0.25, or frame-time regressions above 20% fail the pull request.
market-entrance(settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0; switchesHOS_OUTPUT_RES=1280x720,RX_VK_AUTO_TUNE=0), then teleport to Market, take the picture market to compare with main, measure market for 60 s (after 10 s warm-up), teleport to Kokiri Forest, take the picture forest to compare with main, measure forest for 60 s (after 10 s warm-up); 3 runs on each side.