test: cover a descriptor key from a root parameter #1760
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1767"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T18:15:46Z.
What
Stage.descriptorintools/startup/gfx2hlsl.pyhas two shapes of answer:The fixture only builds the table case (
subs = {8: ('ptr', ('table', 0))}), so the second branch wasunreachable for every check. Replacing it with
return 'bogus', 12left all sevengfx2hlslchecks green:Change
One case that builds the scalar symbol state for a root parameter and asserts the key, including the
None:Both halves matter: a key that reports the right source but
0instead ofNonewould look like the first entry of atable, which is the confusion the
descbranch was written to avoid.Tested
Scope
One test file, no behaviour change. The
raise Unsupported('descriptor operand %s holds %s')line at the end of thesame function is still unreached; I did not add a case for it because reaching it needs a symbol entry of a third shape
and I could not name one the translator actually produces.
Notes
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T18:16:48Z.
Correction to my own note at the end of the description: the final
raise Unsupported('descriptor operand %s holds %s')indescriptoris reached. I claimed it was not, and that was wrong — replacing it withreturn ('x', None)makesstartup_inline_sampler_check.pyfail, so the inline sampler fixture already drives that branch.Rechecked with the same seven checks:
So this PR closes the one branch that was genuinely unreached (
s[0] == 'ptr'), and the message after it stays covered by a check that predates the change. No edit to the diff needed; only the last paragraph of the body was wrong.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T19:34:07Z.
Review: COMMENTED
Reviewed head
8373ae8f649ff6669b250f4b0018d36147680040. No P1/P2 findings.The new
check_root_descriptorbuilds aStagewithsym = {8: ('ptr', ('root', 2))}and assertsdescriptor('s[8:11]') == (('root', 2), None). This matches theptrbranch ofStage.descriptorintools/startup/gfx2hlsl.py. The test checks both the root source and theNoneoffset, so a root key cannot be confused with the first entry of a table. It is test-only, and the comments describe behavior without outside material.Commands run locally on Linux in a clean worktree:
git diff --check origin/main...HEAD-> rc 0python -B tests/bidi_controls_check.py-> rc 0python -B tests/startup_translator_check.py-> rc 0 (0 failed)Mutations in
tools/startup/gfx2hlsl.py(each reverted withgit checkout -- .):descriptorreturns(s[1], 0)instead of(s[1], None)forptr-> the check FAILS (rc 1: got(('root', 2), 0)).descriptorreturns(('table', 0), None)forptr-> the check FAILS (rc 1).Windows 2025 will be verified before any merge, once the overlap with the other PR touching
tests/startup_translator_check.pyis resolved. This is a review comment only, not an approval.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T20:29:08Z.
Review: COMMENTED
Review of head
8373ae8f64(tests/startup_translator_check.py only; pure-Python fast path). No P1, no P2.Commands run locally:
Mutations of the logic in tools/startup/gfx2hlsl.py, each reverted with git checkout:
The new check kills both mutations. Windows 2025 runs are not applicable (tests/**/*.py only).
AI-assisted; commands listed were executed locally.