Repository navigation
Conversation
…ops are component-wise
Contributor
|
Tested Test Suite Execution
Negative ControlReverted
Hygiene Checks
LGTM! AI-assisted: verified and reviewed on Windows 11 environment. |
|
Verified commit AI-assisted verification. |
This was referenced Nov 23, 2026
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.
Two gaps in the mini interpreter's handling of vector operands, found by running hand-built modules through it and comparing its vector path with its own scalar path.
Integer comparisons.
OpIEqual,OpINotEqualand the eightOp[US](Less|Greater)Than[Equal]forms returned one Python bool for a vector operand: tuple equality for the first two, lexicographic tuple order for the unsigned ordered forms, and "signed comparison of a vec" for the signed ones. SPIR-V defines the result as a bool vector with one predicate per component. So extracting a component raisedTypeError, and(4,1) < (2,8)was a singleFalseinstead of(false, true). Operands are now compared per component, signed at the element width; scalars take the same path as before.GLSL.std.450 float ops.
FAbs,FSign,FMin,Sqrt,Exp2,Log2andInverseSqrtpassed a whole vector toabs()/math.sqrt()and raisedTypeError, whileFMax,FClamp,NMin,NMaxandRoundEvenin the same file already work per component. Each component now goes through the existing scalar implementation, and an undefined component still raises the sameUnsupportedConstruct. The five ops that already handled vectors also accept a constant composite (a list in the interpreter) now.Scope, plainly: the translator emits these operations only on scalars today, so this is reachable from hand-written modules and tests, not from translated shaders, the same reachability as #8149. Vector
Fractis left as the clean refusal it already is.Relation to other open PRs on this file: #4802 fixes vector
OpSelect, a typed PushConstant load and vectorUMin/UMax/UClamp, and #4768 keeps binary64Fma/Sqrt/InverseSqrtin binary64. Different branches, but nearby lines, so one of us may need a rebase.Tested on Linux, CPython 3.14, CPU only, hand-built SPIR-V:
python -m unittest discover -s tests/semantic -p test_interp.py54 OK; with onlyspirv_mini_interp.pyreverted, the two new tests error in all 32 subtests.compileall,check_no_game_data.pyandgit diff --checkare clean. The agent also ran the whole semantic suite once (447 files; the two files red there,test_image_atomics_guardandtest_image_store_d16, are red without this change too, by its account).Claim: #8047.
AI-assisted (DeepSeek V4.1 Flash wrote it; gated and re-run with Claude Code).