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

Closed
KelboLive wants to merge 1 commit from upstream-pr/1725 into main
KelboLive commented 2026-11-24 17:53:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-24T17:53:40Z.


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:
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6588051863 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1725). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-24T17:53:40Z. --- 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:
ChazY11 commented 2026-11-24 19:01:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T18:24:49Z.


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.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7140609924 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1725#issuecomment-7140609924). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-24T18:24:49Z. --- ## 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.
ChazY11 commented 2026-11-24 21:27:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T21:21:34Z.


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.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7144824543 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1725#issuecomment-7144824543). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-24T21:21:34Z. --- 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.
upstream-sync closed this pull request 2026-11-25 19:03:25 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1718
No description provided.