fix(vk): with PsychoV35, the shader preparation builds the scene's pipelines in RGBX16F too, so they no longer compile when first drawn #2765
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
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2765
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/psychov35-scene-pipelines"
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?
TL;DR
Prepare both scene pipeline formats for eligible Native HDR + PsychoV35 settings so entering a new area can reuse pipelines the Builder already made. In two matched Windows RTX 4070 pairs, recorded pipeline creation near first Market entry dropped from 4.20–5.16 s to 83–90 ms. Mean cold preparation rose by 9.39 s (+1.65%).
Summary
Since #2424, players using Native HDR and PsychoV35 can see shaders and textures pop in on first entering a new area. The shipped pipeline list describes packed R11G11B10F targets, while play uses RGBX16F for eligible single-sample targets. Those pipelines can be compiled on their first draw.
The Builder passes the selected profile into shader preparation and includes scene mode in its preparation key. The renderer retains the original version-2 records and prepares a second RGBX16F variant when the colour target and view match, the record is single-sample, and the selected settings enable it. The setting check is available during headless preparation. Start with
scene_targets_rgba16fandstate_list_readingpu/vk/vk_draw.cpp, thenscene_preparation_modein the Builder.Testing
Tested: On head
2f259a85against main1413b172, the Windows game-free host options-path, pipeline counts, computes, portable states, and scene format fixtures passed. The Builder regression for a missing selected-profile settings file and the unprofiled fallback passed locally with Rust 1.99.1 and in CI. A fresh preparation receipt could be reused in the focused Builder check. Substituting the exact main state-list reader into the same portable fixture failed at the assertion that expects the additional RGBX16F record. CI renderer compile checks passed on Windows and Linux, with and without FSR 4.Clippy and Rust workspace unit tests passed on the
2f259a85retry. Rust CI still reported the earlier workspace-formatting difference inhost_sources_tests.rsand synthetic end-to-end failure on missingimage.bin. The website build completed and its/settings/branding audit failed in input paths unchanged from exact main. The game-free shards recorded 432 passes, 10 failures and 6 skips, and 422 passes, 21 failures and 4 skips. The failing test names match the prior PR run. Local checks on exact main reproduced the pipeline-tour, switch-table, input-background, and Windows-on-Linux failures. The complete exact-main CI comparison is pending. Measured-head CI Prior PR CI Measured main CIThe public merge
0b1ea3daonto01539efdpreserves the exact measured shader patch. The Guide check on both commits locally reports the same eight Graphics screenshot source references changed by incoming frame cap and keyboard/menu work. Independent review of the refresh found no blocker in the shader patch and recommended one fresh Windows HDR integration smoke because the incoming host and renderer use a new ABI. A merge preview againstb6d274d7, which adds the Deck desktop window-focus fix, was clean and also preserved the measured patch byte for byte. Current-head CI Merge-base CIThe integration smoke passed on a freshly built Windows host and renderer from
0b1ea3da. Shader preparation completed on the RTX 4070 and gameplay reused the resulting cache. The game opened an HDR10 surface, reported Native HDR and PsychoV35 with the default 60 FPS cap, reachedMarket_ChildfromHyruleField_Childon the same controller route, and exited cleanly. This confirms integration on the refreshed build. The measured pairs are below.Two matched Windows RTX 4070 pairs completed on the exact builds with independent cold caches and reversed run order. All four arms opened a 3440×1440 HDR10 swapchain, used Native HDR and PsychoV35, reached the same Market position from the same Field save with identical stick input, and exited cleanly. Local visual pop-in observation is pending.
On Windows 11 with Radeon RX 9070 XT and AMD 26.11.2, nwgat reported first-entry pop-in largely gone on an earlier build identified as
7d4deb29-dirty. No white textures or slow reload were seen during their reported session. The shader patch has since narrowed the prepared variants to single-sample records and corrected the Builder's profile and cache handling. The live target promotion is unchanged. This remains qualitative Windows Radeon evidence. Earlier reports and measurementsStill to test:
Measurements
Verdict: Both matched pairs recorded less pipeline work near first Market entry. Average cold preparation took 9.39 s longer (+1.65%), with the two pairs moving in opposite directions. Launch with prepared caches took 2.52–4.73 s longer to reach first present.
Setup: Windows, NVIDIA 621.01, RTX 4070, 3440×1440 HDR10, Native HDR with PsychoV35, Compile Shaders Most and independent fresh shader and driver caches. The route window runs from the last periodic renderer sample before movement through the last sample in the post-entry wait. The graphics census starts at its last pre-route sample and ends at close. Pipeline time sums recorded renderer work. The shader patch is unchanged at the refreshed head. The elapsed times below remain pinned to the binaries that ran.
1413b1722f259a85Earlier matched preparation tests measured +25.76 s (+5.8%) on
7d4deb29against694ae582, before single-sample filtering. Earlier measured pairsRisks
HOS_SCENE_RGBA16F=0disables the extra preparation and #2424’s RGBX16F promotion.Checklist
Ready for review
main; the title is a Conventional Commit. (main added the Deck desktop window-focus fix after01539efd)mise run testpasses (any failure that also fails onmainis named). (matching CI in progress)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here. (portable reader check above)tests/that reads changed source is updated, not weakened.mainand here, for a change that shows on screen. (first-entry comparison pending)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Request changes. The RGBX16F copies can prepare the matching graphics pipelines, but the normal Builder subprocess can miss the player setting that turns the copies on. The patch also breaks existing source-extraction fixtures.
For a player this aims to reduce first-draw pipeline work after preparing with HDR Native + PsychoV35. The V2 resolver uses the same attachment-format conversion as replay, including the R11G11B10F view over an RGBX16F texture. The duplicate is a candidate key only: live promotion also checks texture flags, dimensions, levels, and samples, which the state list cannot fully identify. In particular, skip multisample records known to be ineligible and cover one promoted target, one unpromoted target, and a mixed attachment case. Leave compute and V1 records behaving as before.
Builder preparation explicitly refreshes the lists even with a warm shader seed. The opt-in background-update start also reads the lists before precompile. An already-prepared ordinary start or a live tone-mapper change does not guarantee that refresh. Please document this scope and verify the option source in a normal profile build as well as shader-only preparation. Builder child environment · Profile options lookup
Evidence: Renderer compile checks passed on Windows and Linux with and without FSR 4. Both game-free shards are red, as are Rust, third-party/Guide, and Website checks. The fixture issue below is confirmed in source. The other red jobs have not been attributed to this patch. No new game or test run in this review.
After the fixes, please compare matched cold preparations and first Market entries against main on the Radeon 8060S, with Native HDR and PsychoV35 set before preparation. Record preparation time, pipelines built at preparation and first draw, and visible pop-in on the same route. Retest an already-prepared run and an in-game switch separately. Keep the separate white-texture transition outside this result.
Reviewed head
97b77930against694ae582.@ -2646,0 +2646,4 @@/// Whether play makes the game's R11G11B10F render targets RGBX16F (host/scene_format.h, nvn_native.c made_desc): HDR Native with/// the PsychoV35 tone mapper, unless HOS_SCENE_RGBA16F=0. The shader preparation then builds a list's pipelines for both formatsbool scene_targets_rgba16f() {const char* e = getenv("HOS_SCENE_RGBA16F");[P2] Honor the same HOS_SCENE_RGBA16F values as live play. The live texture builder uses env_on_or(..., 1), which treats false/off/no as disabled. This literal-zero check still warms RGBX16F in those cases. Use the shared helper and cover unset, 0, false/off/no, and on.
@ -2646,0 +2649,4 @@const char* e = getenv("HOS_SCENE_RGBA16F");// (the rows, not scene_tonemap_on: the Builder's preparation has no swapchain to say the display is HDR; on an SDR display the// extra pipelines are only unused)return (!e || strcmp(e, "0") != 0) && opts.hdr == 2 && opts.hdr_tonemap == 1;[P1] Pass the selected profile into shader preparation. shaders.rs game_env removes LONGSHOT_PROFILE with the other LONGSHOT_ variables, and run_child only restores job/store settings. options_path.c falls back to the game folder, while normal play uses the profile settings.ini. Selecting Native HDR + PsychoV35 in that profile can therefore leave these options at their fallback values during both full and shader-only preparation. Pass the selected profile explicitly after sanitizing the child environment, and test that both paths actually read its settings.
@ -2670,3 +2678,2 @@StateRec r;while (fread(&v, sizeof v, 1, f) == 1)if (!v.kind && state_v2_resolve(v, r)) out.push_back(r);const bool scene = scene_targets_rgba16f();[P2] Update the fixtures that extract state_list_read. test_pipeline_state_portable.py, test_pipeline_state_computes.py and test_pipeline_state_counts.py currently paste the function without this new helper or enum declarations for both NVN formats. Their generated translation units cannot compile on this head. Supply the dependencies and exercise the real duplication path, including retained R11, the matching RGBX16F key and disabled settings.
Re-reviewed
74cfef99a92234b02379a6f697af71da72cc25ebagainst694ae582. Hold the Radeon 8060S test at this head.LONGSHOT_PROFILEafter environment cleanup, including retries. This addresses the profile finding when preparation actually runs.env_on_orsemantics as live play. The Windows counts, computes, and portable state fixtures passed, including eight portable flag/settings cases. This addresses the two renderer fixture and flag findings.supervisedcalls inshaders_outcome_tests.rs:38,62still need the new profile argument. Clippy and cargo test fail to compile the build-driver test target, so the new profile regressions have yet to run. Rustfmt also flags the changedprepare_insignature. The separate synthetic end-to-endimage.binfailure needs baseline attribution. The Python lint findings are on lines already present on the base. The Guide check points togpu/vk/device_policy.h, outside this diff.Once the fixed head passes the Builder profile tests and its Windows renderer build is verified, run the supervised Market comparison with matched Native HDR and PsychoV35 settings and independent cold cache state for both builds. Confirm shader preparation ran with the selected profile, and record preparation time and the first Market entry on both. Preparation can reuse a prior receipt, so an existing prepared folder does not establish cold coverage.
dev compile, and a failure there says what the builder said #2774dev compile, and a failure there says what the builder said #2774@review
Recommendation: Approve. A preparation made for different tone-mapper settings can be reused without building the RGBX16F pipelines, leaving the first-draw compiles this change aims to prevent. The gain and preparation cost also remain unmeasured. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The change prepares an additional pipeline format for Native HDR with PsychoV35 and passes the selected profile to Builder preparation. It can reduce first-draw compilation, at the cost of additional preparation work, but receipt reuse can skip that work for the settings that need it.
Should fix (1): not blocking, but worth doing before merging.
builder/crates/build-driver/src/shaders.rs:781: Preparation reuse does not account for the settings that now determine which pipeline variants are built. (more on the line) Do: Include the effective scene-format preparation mode in the receipt and local preparation key, and ensure the fast reuse check uses the same mode. Add a test that prepares with the mode off and then requests preparation with it on through a shared cache.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_draw.cpp:2685: The claimed reduction in first-draw compilation and the extra preparation cost have not been measured. (more on the line) Do: Compare independent cold preparations and repeated matched Castle Town entries on the reported Radeon system against base, recording preparation time, pipeline counts, cache size, first-draw compiles and frame times. (@fixdoes its part first: Skip extra variants for records known to be ineligible for live promotion, such as multisampled targets.)gpu/vk/vk_draw.cpp:2678: The new preparation path has no reported Tier 1 hardware coverage. (more on the line) Do: Run preparation and a representative scene on the affected Tier 1 NVIDIA and AMD Windows and Linux configurations and Steam Deck, recording failures and preparation cost.@fixcan do L1 and L2.Questions (1) (not confirmed from the code; they don't hold the recommendation)
Checks: Failing on this head, which is behind its base, where they pass:
CI / Third-party parts and guide screenshots (pull_request),CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request),CI / Website build and checks (pull_request),CI / Game-free checks (run_all.py, part 1/2) (pull_request),CI / Game-free checks (run_all.py, part 2/2) (pull_request).@rebase(or@fix) brings it up to date and runs them again; not held against it.More: does it help, other systems, switches, what was read
Does it help: Unproven. The pull request reports no game runs or matched measurements against base
694ae582; the portable fixture exercises the added record conversion but does not establish the in-game gain.Other systems: The changed state-list reader also handles player-recorded lists and background preparation; version 1 and compute records retain their existing paths. The renderer and Builder run on Windows and Linux across GPU vendors, but this head has no reported game or platform runs. Shared shader-cache receipts can cross profiles.
Switches: No switch is added or removed. The new reader consults the existing HOS_SCENE_RGBA16F switch, default on, using the same on/off parsing as live texture creation. Its existing default is not measured by this pull request.
Reviewed:
7d4deb299fagainst694ae5820a: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, the full diff and commit log, shaders_outcome_tests.rs and shared_preparation.rs. Read the changed sections and relevant callers and helpers in the remaining changed files; skimmed their unrelated portions, including most of vk_draw.cpp. docs/review-checklist.md was absent. No recorded runs or translations were changed.; nothing run (a code review).Checked and fine:
Testing: No code or tests were run, as requested. The supplied review reports fixture runs on an earlier head; the pull request reports no game runs or measurements on this head.
Overlaps and merge order: No overlapping pull requests were available in the supplied context.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -752,7 +781,7 @@ pub fn prepare_unless_kept(return true;L1 (should fix): Preparation reuse does not account for the settings that now determine which pipeline variants are built.
When: A profile prepared with PsychoV35 off publishes a receipt for the renderer, lists, driver and level. A second profile using the same shader cache with Native HDR and PsychoV35 enabled can match that receipt, so prepare_unless_kept returns before reading its settings and its RGBX16F pipelines still compile on first draw.
Do: Include the effective scene-format preparation mode in the receipt and local preparation key, and ensure the fast reuse check uses the same mode. Add a test that prepares with the mode off and then requests preparation with it on through a shared cache.
@ -2670,3 +2677,2 @@StateRec r;while (fread(&v, sizeof v, 1, f) == 1)if (!v.kind && state_v2_resolve(v, r)) out.push_back(r);const bool scene = scene_targets_rgba16f();L3 (should fix): The new preparation path has no reported Tier 1 hardware coverage.
When: The added pipeline variants are passed to Vulkan drivers on Windows and Linux, including Steam Deck, and no run on this head shows that preparation and subsequent play complete on those systems.
Do: Run preparation and a representative scene on the affected Tier 1 NVIDIA and AMD Windows and Linux configurations and Steam Deck, recording failures and preparation cost.
@ -2673,0 +2682,4 @@// (the same draw into the scene's light made RGBX16F with PsychoV35, host/scene_format.h: the lists were// recorded with it R11G11B10F, so without this each such pipeline is made when it is first drawn)StateRec2 w = v;bool any = false;L2 (should fix): The claimed reduction in first-draw compilation and the extra preparation cost have not been measured.
When: With Native HDR and PsychoV35, the reader adds pipeline records and preparation compiles them, but there is no matched route showing how many first-draw compiles or visible stalls this avoids, or how much preparation time and cache space it adds.
Do: Compare independent cold preparations and repeated matched Castle Town entries on the reported Radeon system against base, recording preparation time, pipeline counts, cache size, first-draw compiles and frame times.
dev compile, and a failure there says what the builder said #2774@fix
Recommendation: Approve. The code is ready: only testing is left. The change can prepare candidate RGBX16F pipelines, but its effect on first-draw compilation and its preparation cost are unmeasured. Hardware validation of the new path is also still missing. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
e2c1cab6f9. I mergedmain(a3e0d2316e) into it, as it has merge commits. I edited its description to match the change.Changed
Changed in part (the rest is for the author)
Already done
Nothing was built or run: the checks run again on the new head.
Preparation now includes candidate scene pipelines for Native HDR with PsychoV35 and keys reuse by scene mode. This may reduce first-draw compilation at the cost of additional preparation work; the size of either effect is unknown.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_draw.cpp:2685: The first-draw compilation reduction and extra preparation cost remain unmeasured; multisampled records are now excluded. When: With Native HDR and PsychoV35 enabled, preparation builds additional candidate pipelines, but their cost and effect on first Market entry are unknown. Do: Compare matched cold preparations and Market entries against main, recording preparation time, pipeline counts, first-draw compiles and visible pop-in.gpu/vk/vk_draw.cpp:2678: The new preparation path has no reported Tier 1 hardware coverage. When: The added pipeline variants are passed to Vulkan drivers on Windows and Linux, including Steam Deck, and no run on this head shows that preparation and subsequent play complete on those systems. Do: Run preparation and a representative scene on the affected Tier 1 NVIDIA and AMD Windows and Linux configurations and Steam Deck, recording failures and preparation cost.Checks: they run again on this head (
CI / Third-party parts and guide screenshots (pull_request),CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request),CI / Website build and checks (pull_request),CI / Game-free checks (run_all.py, part 1/2) (pull_request),CI / Game-free checks (run_all.py, part 2/2) (pull_request)failed on the last one); a failure shows on the pull request.Also noticed (2; not asked for, not blocking)
7d4deb299f, while the checked-out HEAD is 8308f43fabfff7f3f06a23bce1cd2d21e2419a7f.More: does it help, other systems, switches, what was read
Does it help: Unproven: no matched preparation times, pipeline counts, first-draw compilation counts, or pop-in results are reported against main.
Other systems: The renderer path affects Vulkan drivers and both Windows and Linux. The selected profile and shared preparation cache also affect Builder reuse; the new shared-cache test is present but has not been reported running.
Switches: No switch added or changed. Existing HOS_SCENE_RGBA16F defaults to enabled and also controls live scene promotion; preparation now uses its existing on/off semantics.
Reviewed:
e2c1cab6f9againsta3e0d2316e: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the fix diff, the state-list reader and resolver, the scene-mode key and preparation reuse paths, and relevant environment and options readers. Skimmed the broader base diff, commit log, and test changes; did not read every changed code file in full. No review checklist file was found.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run project code were executed. The description reports no game run or matched measurements, and CI has not run on this head.
Overlaps and merge order: Not checked; network access is unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
@ -674,0 +766,4 @@let (setting, max) = match &line[..eq] {b"hdr" => (&mut hdr, 2),b"hdr_tone_mapper" => (&mut tone, 1),_ => continue,L9 (blocking): The scene-mode reader parses every setting as an i32 before checking its name, so an unrelated large numeric value prevents preparation from being keyed or reused.
When: A profile containing an auto_for or auto_tuned hexadecimal fingerprint whose initial decimal digits exceed i32 returns None from scene_preparation_mode. Preparation::check then returns None, would_prepare requests preparation at each start, and successful preparation cannot save a reuse record.
Do: Select hdr and hdr_tone_mapper before parsing their values, and add a reuse test with an unrelated large numeric setting such as auto_for.
Shader preparation and Radeon gameplay evidence
Two fresh-cache pairs on Windows with an RTX 4070 (NVIDIA 621.01), Native HDR, PsychoV35 and Compile Shaders Most compared baseline
694ae582with PR revision7d4deb29. The second pair reversed the run order. Timing covers the shader preparation process.Average overhead was 25.76 s (+5.8%). Both pairs built 38,192 → 68,515 graphics pipelines (+30,323). Compute pipelines held at 5,006. All four preparations completed successfully. First-draw compiles and gameplay frame times still need a matched route test.
Nwgat reported that pop-in was largely gone on the RX 9070 XT, Windows 11, AMD 26.11.2. After teleporting to a new area and toggling HDR with PsychoV35 selected, they saw no white textures or slow reload during that session. Their log identified the build as
7d4deb29-dirty. Broader live-switch behavior and Radeon 8060S coverage remain open.These results apply to the tested builds. The current PR head still needs a fresh-cache preparation and first-entry route comparison.
@Beanstalk Please propose a matched cold shader-preparation and first-entry comparison for Longshot PR #2765 at
2f259a85ecea85b3b86650cedf9281421bd170aeagainst official1413b172907220e21ae0f9503e040d0b115bcda9. Hold execution until the changed Builder checks have passed and a BigBean approves this exact head. Verify both revisions before building. Use each volunteer’s local game inputs and a disposable profile.Coverage requested where the available machine can present Native HDR: Windows discrete Radeon RX 6000–9000, Linux desktop Radeon RADV and NVIDIA RTX, and Steam Deck OLED in Gamescope. If Native HDR is unavailable on that system, label it as an SDR control and verify preparation and first entry still work. Local Windows RTX 4070 and volunteer Windows Radeon 8060S are being coordinated separately.
Use Native HDR, PsychoV35, Compile Shaders Most, frame generation Off, and matched resolution and upscaler settings per PC. Start each arm with independent cold shader and driver pipeline caches. Use a fixed initial save and the same first entry from Hyrule Field into Castle Town Market. Verify the effective HDR mode and the preparation ran against the selected profile. Where supported, run two pairs in reversed order. Give preparation elapsed time, graphics and compute pipeline counts, first-entry pipeline compiles or wait time, and build and run outcome. Have an observer report any visible pop-in. If no approved route or expected save is available, record that limitation rather than substituting a warm run. Share only the aggregate results and test environment.
Beanstalk test farm
Commit
0b1ea3d· approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.WIP: fix(vk): with PsychoV35, the shader preparation builds the scene's pipelines in RGBX16F too, so they no longer compile when first drawnto fix(vk): with PsychoV35, the shader preparation builds the scene's pipelines in RGBX16F too, so they no longer compile when first drawn