Shader: prove the packed screen-position input for a fullscreen composite #1725

Closed
github-bot wants to merge 1 commit from gh-pr/1725/head into gh-pr/1725/base
Owner

@⁠KelboLive on GitHub · 2026-11-24 17:53 UTC · original
KelboLive:shader/packed-screen-position → main · +5 −0 · 1 files · 1 commits · closed without merging

WIP: #1629 — initial packed-position test harness and CTest registration

  • Add CTest for pure-Python controls
  • Register and
  • Document PS input-mask mapping with five test cases in
  • Acceptance:
**@⁠KelboLive** on GitHub · 2026-11-24 17:53 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1725) `KelboLive:shader/packed-screen-position` → `main` · +5 −0 · 1 files · 1 commits · closed without merging WIP: #1629 — initial packed-position test harness and CTest registration - Add CTest for pure-Python controls - Register and - Document PS input-mask mapping with five test cases in - Acceptance:
Prove PS input-mask source for fullscreen composite (#1629)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:29:03 +00:00
github-bot closed this pull request 2026-11-26 23:29:03 +00:00
Author
Owner

@⁠ChazY11 on GitHub · 2026-11-24 18:24 UTC · original

The new test cannot pass

startup_packed_screen_position_controls is registered with no arguments:

add_test(NAME startup_packed_screen_position_controls COMMAND "${INTAKE_PYTHON}" -B
    "${CMAKE_SOURCE_DIR}/tests/startup_packed_position_check.py")

but that script's entry point takes three required positional arguments:

def main(dxc, renderer, adapter, fxc=None)      # tests/startup_packed_position_check.py:17
if __name__ == '__main__':
    sys.exit(main(*sys.argv[1:]))

so it fails before it reaches a single case:

$ ctest --preset dev -R '^startup_packed_screen_position_controls$' -V
Test command: .../python.exe -B ".../tests/startup_packed_position_check.py"
Traceback (most recent call last):
TypeError: main() missing 3 required positional arguments: 'dxc', 'renderer', and 'adapter'
1/1 Test #333: startup_packed_screen_position_controls ...***Failed 0.26 sec

That is deterministic and platform independent — no device, DXC or fxc is involved before the call fails, so it is also red in the
Run platform-independent Python checks on Linux job.

What the PR looks like it meant

The five cases it names exist, but they live inside main, after the DXC and renderer arguments are used:

32: ('one earlier word', 1, (0x8100, 0x8100), True),
33: ('one earlier pair', 2, (0x8002, 0x8002), True),
34: ('missing metadata', 1, None, False),
36: ('packed position disabled', 1, (0x0100, 0x0100), False),

Only CMakeLists.txt changed in this PR, so nothing provides a no-argument path for them.

Two ways to close it

  1. Split the controls out of main into check_controls() that builds each (label, reg, masks, expected) case through
    pixel_shader and compares the masks, then call it both from main and from a if len(sys.argv) == 1: branch. That keeps
    the new test's intent (five cases, no device).
  2. Give the test the same arguments as the GPU test and let it skip with 77 when DXC or an adapter is missing. Cheaper,
    but then the "controls" test is really a second GPU test under a different name, and SKIP_RETURN_CODE 77 hides it on
    most machines.

The first is closer to what the comment above the add_test promises.

One thing that does work

The TIMEOUT 120 and SKIP_RETURN_CODE 77 properties are set, and the naming separates controls from the _warp/_hardware
runs — the shape of the change is right, only the program it starts does not accept the call.

Verdict

Reviewed 10447f23. Not mergeable as it stands: the added test fails on every platform. The fix is small and I am happy to
review the next push.

Notes

  • AI-assisted review.
**@⁠ChazY11** on GitHub · 2026-11-24 18:24 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1725#issuecomment-7140609924) ## The new test cannot pass `startup_packed_screen_position_controls` is registered with no arguments: ```cmake add_test(NAME startup_packed_screen_position_controls COMMAND "${INTAKE_PYTHON}" -B "${CMAKE_SOURCE_DIR}/tests/startup_packed_position_check.py") ``` but that script's entry point takes three required positional arguments: ```python def main(dxc, renderer, adapter, fxc=None) # tests/startup_packed_position_check.py:17 if __name__ == '__main__': sys.exit(main(*sys.argv[1:])) ``` so it fails before it reaches a single case: ```text $ ctest --preset dev -R '^startup_packed_screen_position_controls$' -V Test command: .../python.exe -B ".../tests/startup_packed_position_check.py" Traceback (most recent call last): TypeError: main() missing 3 required positional arguments: 'dxc', 'renderer', and 'adapter' 1/1 Test #333: startup_packed_screen_position_controls ...***Failed 0.26 sec ``` That is deterministic and platform independent — no device, DXC or `fxc` is involved before the call fails, so it is also red in the `Run platform-independent Python checks on Linux` job. ## What the PR looks like it meant The five cases it names exist, but they live *inside* `main`, after the DXC and renderer arguments are used: ```python 32: ('one earlier word', 1, (0x8100, 0x8100), True), 33: ('one earlier pair', 2, (0x8002, 0x8002), True), 34: ('missing metadata', 1, None, False), 36: ('packed position disabled', 1, (0x0100, 0x0100), False), ``` Only `CMakeLists.txt` changed in this PR, so nothing provides a no-argument path for them. ## Two ways to close it 1. **Split the controls out of `main`** into `check_controls()` that builds each `(label, reg, masks, expected)` case through `pixel_shader` and compares the masks, then call it both from `main` and from a `if len(sys.argv) == 1:` branch. That keeps the new test's intent (five cases, no device). 2. **Give the test the same arguments as the GPU test** and let it skip with 77 when DXC or an adapter is missing. Cheaper, but then the "controls" test is really a second GPU test under a different name, and `SKIP_RETURN_CODE 77` hides it on most machines. The first is closer to what the comment above the `add_test` promises. ## One thing that does work The `TIMEOUT 120` and `SKIP_RETURN_CODE 77` properties are set, and the naming separates controls from the `_warp`/`_hardware` runs — the shape of the change is right, only the program it starts does not accept the call. ## Verdict Reviewed `10447f23`. Not mergeable as it stands: the added test fails on every platform. The fix is small and I am happy to review the next push. ## Notes - AI-assisted review.
Author
Owner

@⁠ChazY11 on GitHub · 2026-11-24 21:21 UTC · original

Re-checked at the current head (6f2ee280): the controls test this PR registers still cannot pass. CMakeLists.txt adds

add_test(NAME startup_packed_screen_position_controls COMMAND "${INTAKE_PYTHON}" -B
    "${CMAKE_SOURCE_DIR}/tests/startup_packed_position_check.py")

with no arguments, while the script ends in

sys.exit(main(*sys.argv[1:]))

and main(dxc, renderer, adapter) takes three:

$ out/pe-env/Scripts/python.exe -B tests/startup_packed_position_check.py
  File ".../tests/startup_packed_position_check.py", line 53, in <module>
    sys.exit(main(*sys.argv[1:]))
TypeError: main() missing 3 required positional arguments: 'dxc', 'renderer', and 'adapter'

So the entry is registered, is selected by -R startup_packed_screen_position, and fails before it can check anything — which is
worse than not registering it, because a red CTest looks like a broken fixture rather than a missing argument.

The neighbours solve it the same way everywhere: startup_buffer_address_check.py, startup_flat_param_check.py,
startup_inline_sampler_check.py and startup_smem_address_check.py all take a controls word and dispatch before touching
dxc. Mirroring that would make the registration honest without changing any case in the file:

def main(argv):
    if argv == ['controls']:
        return controls()
    dxc, renderer, adapter = argv
    ...

I am not touching this branch — it is a WIP for #1629 and the issue has a claim protocol. Flagging the one thing that will
block the merge whenever you pick it back up.

  • AI-assisted.
**@⁠ChazY11** on GitHub · 2026-11-24 21:21 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1725#issuecomment-7144824543) Re-checked at the current head (`6f2ee280`): the `controls` test this PR registers still cannot pass. `CMakeLists.txt` adds ```cmake add_test(NAME startup_packed_screen_position_controls COMMAND "${INTAKE_PYTHON}" -B "${CMAKE_SOURCE_DIR}/tests/startup_packed_position_check.py") ``` with no arguments, while the script ends in ```python sys.exit(main(*sys.argv[1:])) ``` and `main(dxc, renderer, adapter)` takes three: ```text $ out/pe-env/Scripts/python.exe -B tests/startup_packed_position_check.py File ".../tests/startup_packed_position_check.py", line 53, in <module> sys.exit(main(*sys.argv[1:])) TypeError: main() missing 3 required positional arguments: 'dxc', 'renderer', and 'adapter' ``` So the entry is registered, is selected by `-R startup_packed_screen_position`, and fails before it can check anything — which is worse than not registering it, because a red CTest looks like a broken fixture rather than a missing argument. The neighbours solve it the same way everywhere: `startup_buffer_address_check.py`, `startup_flat_param_check.py`, `startup_inline_sampler_check.py` and `startup_smem_address_check.py` all take a `controls` word and dispatch before touching `dxc`. Mirroring that would make the registration honest without changing any case in the file: ```python def main(argv): if argv == ['controls']: return controls() dxc, renderer, adapter = argv ... ``` I am not touching this branch — it is a WIP for #1629 and the issue has a claim protocol. Flagging the one thing that will block the merge whenever you pick it back up. - AI-assisted.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.