fix(pipelines): Match predicted vertex input numeric types #2248
Closed
klimovich008 wants to merge 4 commits from
codex/predict-input-types298 into main
pull from: codex/predict-input-types298
merge into: MagicBeanDev:main
MagicBeanDev:main
MagicBeanDev:github/pr/2893
MagicBeanDev:github/pr/2890
MagicBeanDev:github/pr/2887
MagicBeanDev:github/pr/2878
MagicBeanDev:github/pr/2875
MagicBeanDev:github/pr/2874
MagicBeanDev:github/pr/2873
MagicBeanDev:github/pr/2871
MagicBeanDev:github/pr/2756
MagicBeanDev:github/pr/2897
MagicBeanDev:github/pr/2896
MagicBeanDev:github/pr/2718
MagicBeanDev:github/pr/2842
MagicBeanDev:github/pr/2691
MagicBeanDev:github/pr/2895
MagicBeanDev:github/pr/2743
MagicBeanDev:github/pr/2765
MagicBeanDev:github/pr/2708
MagicBeanDev:github/pr/2732
MagicBeanDev:github/pr/2755
MagicBeanDev:github/pr/2817
MagicBeanDev:github/pr/2876
MagicBeanDev:release-please--branches--main
MagicBeanDev:release-please--branches--main--release-notes
MagicBeanDev:github/pr/2778
MagicBeanDev:github/pr/2888
MagicBeanDev:github/pr/2866
MagicBeanDev:github/pr/2877
MagicBeanDev:github/pr/2800
MagicBeanDev:github/pr/2829
MagicBeanDev:github/pr/2850
MagicBeanDev:github/pr/2889
MagicBeanDev:github/pr/2882
MagicBeanDev:github/pr/2860
MagicBeanDev:github/pr/2849
MagicBeanDev:github/pr/2886
MagicBeanDev:github/pr/2794
MagicBeanDev:github/pr/2840
MagicBeanDev:github/pr/2830
MagicBeanDev:github/pr/2834
MagicBeanDev:github/pr/2719
MagicBeanDev:github/pr/2742
MagicBeanDev:github/pr/2741
MagicBeanDev:github/pr/2820
MagicBeanDev:github/pr/2771
MagicBeanDev:github/pr/2859
MagicBeanDev:github/pr/2858
MagicBeanDev:github/pr/2823
MagicBeanDev:github/pr/2757
MagicBeanDev:github/pr/2769
MagicBeanDev:github/pr/2844
MagicBeanDev:github/pr/2843
MagicBeanDev:github/pr/2673
MagicBeanDev:github/pr/2855
MagicBeanDev:github/pr/2739
MagicBeanDev:github/pr/2807
MagicBeanDev:github/pr/2851
MagicBeanDev:github/pr/2789
MagicBeanDev:github/pr/2814
MagicBeanDev:github/pr/2818
MagicBeanDev:github/pr/2774
MagicBeanDev:github/pr/2772
MagicBeanDev:github/pr/2750
MagicBeanDev:github/pr/2786
MagicBeanDev:github/pr/2785
MagicBeanDev:github/pr/2782
MagicBeanDev:github/pr/2779
MagicBeanDev:github/pr/2775
MagicBeanDev:github/pr/2706
MagicBeanDev:github/pr/2766
MagicBeanDev:github/pr/2747
MagicBeanDev:github/pr/2759
MagicBeanDev:github/pr/2745
MagicBeanDev:github/pr/2740
MagicBeanDev:github/pr/2733
MagicBeanDev:github/pr/2725
MagicBeanDev:github/pr/2727
MagicBeanDev:github/pr/2728
MagicBeanDev:github/pr/2729
MagicBeanDev:github/pr/2721
MagicBeanDev:github/pr/2722
MagicBeanDev:github/pr/2715
MagicBeanDev:github/pr/2714
MagicBeanDev:github/pr/2707
MagicBeanDev:github/pr/2703
MagicBeanDev:github/pr/2705
MagicBeanDev:github/pr/2697
MagicBeanDev:github/pr/2679
MagicBeanDev:github/pr/2676
MagicBeanDev:github/pr/2669
MagicBeanDev:docs/what-hookshot-connects-to
MagicBeanDev:fix/hdr-encode-test
MagicBeanDev:fix/main-tests
MagicBeanDev:fix/play-cache-files
MagicBeanDev:perf/game-barrier-order
MagicBeanDev:feat/heap-lazy
MagicBeanDev:feat/texture-detail
MagicBeanDev:perf/astc-opaque-bc1
MagicBeanDev:fix/fs-dir-lock
MagicBeanDev:fix/framegen-native-kept
MagicBeanDev:fix/update-no-downgrade
MagicBeanDev:port/k10-gcn-f16-mirrors
MagicBeanDev:fix/framegen-mult-cap
MagicBeanDev:chore/release-as-2.1.1
MagicBeanDev:perf/pcache-load-switch
MagicBeanDev:fix/prepare-progress-log
MagicBeanDev:fix/update-closes-stale-game
MagicBeanDev:fix/hdr-scaled-sampled
MagicBeanDev:perf/first-start-preset
MagicBeanDev:perf/zero-upload
MagicBeanDev:fix/vcore-escape-2s
MagicBeanDev:test/fake-gh-atomic
MagicBeanDev:perf/batch-idle-flush
MagicBeanDev:test/finish-stub-a
MagicBeanDev:chore/record-2.1.0
MagicBeanDev:fix/main-red-tests
MagicBeanDev:fix/test-display-startup-driver-cache
MagicBeanDev:feat/mesh-shader-mode
MagicBeanDev:fix/menu-probes-at-startup
MagicBeanDev:fix/fps-counter-classic
MagicBeanDev:fix/test-log-batch-flake
MagicBeanDev:fix/narrow-screen-hud
MagicBeanDev:ci/prereleases
MagicBeanDev:release/v2.0.15
MagicBeanDev:hotfix/v2.0.15
MagicBeanDev:fix/present-ahead-replay
MagicBeanDev:release/v2.0.13
MagicBeanDev:fix/bracket-paths-2013
MagicBeanDev:fix/hdr-overlays-2013
MagicBeanDev:fix/fps-counter-scale-2013
MagicBeanDev:fix/stick-seen-at-rest
MagicBeanDev:hotfix/menu-fits-screen
MagicBeanDev:fix/f1-always-opens-menu
MagicBeanDev:fix/ini-keep-lines
MagicBeanDev:claude/cranky-pike-7cf247
MagicBeanDev:perf/texture-answer-flat
MagicBeanDev:fix/stamp-test-modules
MagicBeanDev:fix/appimage-fonts
MagicBeanDev:fix/display-awake
MagicBeanDev:release/v2.0.12
MagicBeanDev:fix/discord-windows
MagicBeanDev:rc/v2.0.12-tests
MagicBeanDev:fix/dlss-keep-feature
MagicBeanDev:rc/v2.0.12
MagicBeanDev:button-icons
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
autorelease: pending
autorelease: tagged
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
github_actions
Pull requests that update GitHub Actions code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
testing wanted
wontfix
This will not be worked on
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2248
Loading…
Reference in a new issue
No description provided.
Delete branch "codex/predict-input-types298"
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 this fixes
Shader preparation can predict an invalid pipeline when vertex shaders use the same attribute locations with different numeric types. Vulkan reports
VUID-VkGraphicsPipelineCreateInfo-Input-08733for these guesses.Why merge
Change
gpu/vk/vk_predict.cpp: partition fallback donors by numeric input signature.tests/test_predict_numeric_inputs.py: compile the real predictor with synthetic interfaces.docs/tested-configurations.md: record preparation and gameplay checks.Tested
python -I -B tests/run_all.py --jobs 1 --strict predict_numeric_inputs predict_sees_loaded: numeric classes, canonical IDs, unknown/grouped interfaces and exact matching.Not covered
Thanks, this reads correct and conservative to me, and CI is green. A few things below, one of which I'd like numbers for before merge.
What looks right: anything
spirv_vertex_inputscan't classify (16/64-bit, matrices, structs, decoration groups, component-packed or overlapping locations) falls back to exact-module matching instead of being guessed; S32 and U32 are kept apart as Vulkan requires; mesh programs and vertex shaders without generic inputs still shareClass{0}as before; recorded pipelines and the draw path are untouched; and the fixture compiles the real predictor.Minor: tested on AMD with API14 binaries; main is at 15 now (this file isn't affected).
Programs whose vertex inputs come back unclassified (
vs_inputsempty) used to get the location-mask fallback and now get no prediction at all unless that exact module was recorded. Each lost prediction can become a compile during play. Could you post the prepare log'spredicted N ... made Mcounts on main vs this branch (same list, same GPU), so we can see how many predictions this drops besides the invalid ones?The fragment side has the same gap: colour outputs are still matched by location only (
fsig[f.fs_locs]), so an integer output can still be paired with a float attachment (or the other way round) from a donor. It isn't VUID-08733, but it's the same class of invalid guess. Worth the same numeric-class treatment here, or a note that it's left for later.Nit: this check isn't about the prediction seeing loaded programs, so it might read better as its own
tests/test_predict_numeric_inputs.py. The fixture's one-line style (trial(...)and theop(...)chains) is also denser than the rest of the tests.The paired prepare logs on the same RX 9070 XT and recorded scene list show:
The raw list, notes, compute keys and starting caches were identical. The prediction reduction is substantial; the ten validation reports do not prove that all 272 removed guesses were invalid. I have not measured a stutter benefit and am checking unclassified interfaces versus numeric-class mismatches before treating this as ready to merge. These measurements use the matched API14 binaries stated in the description.
Agreed. Fragment output numeric types are still matched by location here; this PR does not fix incompatible fragment-output/attachment guesses. I am leaving that as a separate fix and will make the limit explicit in the description. The zero-VUID result applies only to the tested recorded subset.
A follow-up check with the actual C++
spirv_vertex_inputshelper classified all 68 sampled real vertex modules; none took the unknown-interface path. An inspected failing donor/target pair is classifiable on both sides but disagrees on float versus unsigned-integer input type at the same location.That supports numeric partitioning as a reason for the reduction, rather than widespread parser rejection in this sample. It does not attribute every omitted prediction or establish the stutter cost. Restoring location-only guesses would reintroduce the reproduced validation failure.
Moved the numeric-input fixture into
tests/test_predict_numeric_inputs.pyand expanded its C++ formatting in5d34f63e. The loaded-program visibility test is restored to its original purpose. The focused checks pass; the numeric test compiles and fails on unchanged main. Full local suite: 341 passed, the same four failures previously reproduced on the unchanged base, 30 skipped.The refreshed numeric-input fixture and existing loaded-shader check both pass in Linux CI. The failing Linux jobs show Ubuntu mirror DNS failures during package installation, then missing
spirv_val/glslang/ccache; AppImage fails at the same package-install step. Windows builder passed. I tried rerunning the failed jobs, but GitHub requires repository admin rights; could a maintainer rerun them?Thanks for the numbers and the follow-up check on the parser, that settles where the reduction comes from.
Heads-up on an overlap: #2323 also stops the prediction from making pipelines whose vertex input types don't match the module (the same VUID-08733 class). It reads each module's input types and checks every candidate layout against them; when the most common layout for a signature doesn't fit, it takes the most common one that does, so variants still get a pipeline rather than none. On the shipped list here (NVIDIA) that removes 8,209 wrong-type predictions, and none of the 15,330 recorded draws fail the check. Both PRs change the same part of
vk_predict.cpp, so only one of them should land.What #2323 doesn't have yet is a validation-layer count, which you have set up. Would you be able to run #2323's head on the RX 9070 XT with validation on, on the same scene list, and post the VUID-08733 count and the predicted/made numbers? If it still produces 08733 errors, I'd fold your stricter check into #2323 for the cases it misses. Fragment-output numeric matching stays a gap in both, as you noted.
Closing in favour of #2323, which covers the same wrong-type predictions while keeping a fitting pipeline for each variant. Thanks for the investigation and the AMD validation numbers; the fragment-output gap you found is worth its own PR, and if a validation run of #2323 still shows 08733 errors, your stricter check is the fallback.