Repository navigation
Fix Pyright inference in the logic-op shader generator - #1019
Closed
thehobbit85 wants to merge 2 commits into
Closed
thehobbit85 wants to merge 2 commits into
thehobbit85 wants to merge 2 commits into
Conversation
This was referenced Nov 3, 2026
thehobbit85
pushed a commit
to thehobbit85/nxnative
that referenced
this pull request
Nov 3, 2026
(cherry picked from commit ff1279b)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstream commit f714e138 fixes the generator’s Pyright inference on main. Compared with this PR, the generator syntax trees match after renaming two locals. Eight CPU tests passed on main and all 128 successful shader variants matched exactly in source and entry names. The generated header must follow main’s current inputs. The separate geometry-fixture teardown and its ownership assertions remain tracked in #959.
Original proposal and validation
Cause and fix
Main at
b1dee89cintroduced a Pyright error indmsh_logic.variant. The generator usedapplyfor a list of shader assignments, then reassigned it to the joined Metal source string. Pyright retained the list possibility when it checked the regular-expression callback. The generator now accumulates the list inassignmentsso the callback captures a string. The Python lint job on main and the same check on #684 and #896 reproduced this error.The generated header changes the shader-chain version from
be66496d6205tob669b3d7a206because the chain hashes the generator source. Rebuild shader libraries for the new cache namespace. The first commit carries the geometry-test fixture repair from #959, which the C lint job also needs on this base. The generator fix and its header are together in the second commit.Validation
Game coverage
The regression selection covers Xenoblade Chronicles 2 for integer OR, Skyward Sword HD for normalized OR, Breath of the Wild and Super Mario Bros. Wonder for NVN coverage, and Pokémon Legends Z-A for its available shader corpus. The usage manifests also identify Pokémon Scarlet and Tears of the Kingdom as logic-op users.
The five-game regression command stopped before comparison because only Z-A had a local Mac build. The compiler preflight found Metal 32023.921.6 on this machine. Full shader rebuilds require the pinned 32023.922.4. Validation on game data therefore covers the cached Z-A source comparison above. Full library rebuilds, gameplay and device testing remain unverified.