tests: report what the mesh cache directory holds when a request part is missing #3874

Manually merged
github merged 3 commits from github-bot/gh-3872 into gh-pr/3872/base 2026-12-02 21:11:26 +00:00 AGit
Owner

@⁠triggered02 on GitHub · 2026-12-02 16:32 UTC · original
triggered02:test/mesh-cache-failure-diagnostic → main · +15 −3 · 1 files · 3 commits · merged 2026-12-02 21:09 UTC

Refs #3824.

That flake has exactly one CI reproduction, and its log cannot be diagnosed:

File "tests/startup_indirect_mesh_cache_check.py", line 205, in run_heap
ValueError: not enough values to unpack (expected 1, got 0)

It names the unpacking and nothing about the directory, so the one occurrence we have does not say whether the part was in a different directory, had a different name, or was genuinely never written. This makes the failure report that.

Change. Both call sites go through a helper:

def require_request_part(work, result):
    markers = list(work.glob('req_*.m86'))
    if len(markers) != 1:
        entries = sorted(f'{path.name} ({path.stat().st_size} bytes)' for path in work.iterdir())
        raise AssertionError(
            f'expected one req_*.m86 in {work} after the fixture returned {result}, found {len(markers)}; '
            f'directory holds {entries}')
    return markers[0]

No retry and no wait. publish_shader_request writes the part as req_<key>.<ext>.<pid>.tmp and then MoveFileExWs it into place (d3d12_draw.inl:572-583), so it is synchronous; adding a retry would mask a genuinely missing part instead of fixing anything. This change only makes the next occurrence self-describing.

Checked both paths here — Debian, clang-cl build of the fixture, Windows CPython under Wine:

# failure path, directory without the part:
AssertionError: expected one req_*.m86 in /tmp/tmpcndnwb6c after the fixture returned 0,
  found 0; directory holds ['source.ms.dxbc (10 bytes)']

# passing path, fixture itself, twice:
startup_indirect_mesh_cache_check.py <dxc.exe> <fixture.exe> warp --heap   -> exit 0
  "heap window: two typed buffers, swapped, empty, raw and uint slots matched; ..."

Not established. I could not reproduce the flake locally (8/8 passes with the fix reverted), so the new message has not been seen against a real occurrence — only against a synthesised missing directory. The Windows job is the check for the passing path.

**@⁠triggered02** on GitHub · 2026-12-02 16:32 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3872) `triggered02:test/mesh-cache-failure-diagnostic` → `main` · +15 −3 · 1 files · 3 commits · merged 2026-12-02 21:09 UTC Refs #3824. That flake has exactly one CI reproduction, and its log cannot be diagnosed: ``` File "tests/startup_indirect_mesh_cache_check.py", line 205, in run_heap ValueError: not enough values to unpack (expected 1, got 0) ``` It names the unpacking and nothing about the directory, so the one occurrence we have does not say whether the part was in a different directory, had a different name, or was genuinely never written. This makes the failure report that. **Change.** Both call sites go through a helper: ```python def require_request_part(work, result): markers = list(work.glob('req_*.m86')) if len(markers) != 1: entries = sorted(f'{path.name} ({path.stat().st_size} bytes)' for path in work.iterdir()) raise AssertionError( f'expected one req_*.m86 in {work} after the fixture returned {result}, found {len(markers)}; ' f'directory holds {entries}') return markers[0] ``` **No retry and no wait.** `publish_shader_request` writes the part as `req_<key>.<ext>.<pid>.tmp` and then `MoveFileExW`s it into place (`d3d12_draw.inl:572-583`), so it is synchronous; adding a retry would mask a genuinely missing part instead of fixing anything. This change only makes the next occurrence self-describing. **Checked both paths here** — Debian, clang-cl build of the fixture, Windows CPython under Wine: ``` # failure path, directory without the part: AssertionError: expected one req_*.m86 in /tmp/tmpcndnwb6c after the fixture returned 0, found 0; directory holds ['source.ms.dxbc (10 bytes)'] # passing path, fixture itself, twice: startup_indirect_mesh_cache_check.py <dxc.exe> <fixture.exe> warp --heap -> exit 0 "heap window: two typed buffers, swapped, empty, raw and uint slots matched; ..." ``` **Not established.** I could not reproduce the flake locally (8/8 passes with the fix reverted), so the new message has not been seen against a real occurrence — only against a synthesised missing directory. The Windows job is the check for the passing path.
startup_indirect_mesh_cache_heap_warp failed once in CI (#3822) with

  File "tests/startup_indirect_mesh_cache_check.py", line 205, in run_heap
  ValueError: not enough values to unpack (expected 1, got 0)

which names the unpacking but says nothing about what was in the directory, so
the one reproduction we have cannot be diagnosed from its own log. Both call
sites now go through require_request_part(), which reports the work directory,
the count found and the full listing with sizes on failure.

No behaviour change on the passing path: the same single part is returned. No
wait or retry is added — publication is synchronous file I/O in
publish_shader_request (temp file then MoveFileExW), so a retry would hide a real
missing part rather than fix anything.

Checked both ways here:
  require_request_part on a directory without the part raises with the listing
  ('... found 0; directory holds [\'source.ms.dxbc (10 bytes)\']')
  and the fixture itself still passes twice through the new helper:
    startup_indirect_mesh_cache_check.py <dxc> <fixture> warp --heap -> exit 0

Refs #3822
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 17:22:39 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-12-02 16:36 UTC · original · edited 2026-12-02 16:40 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T16:40:32.825419Z 8d12cdf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-12-02 16:36 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3872#issuecomment-7352201584) · edited 2026-12-02 16:40 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"8d12cdf733db661f3038f6d3fba706262adf3bec","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-12-02T16:40:32.825419Z">2026-12-02T16:40:32.825419Z</relative-time> | `8d12cdf` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-02 16:41 UTC · original · requested changes

The missing-marker path in run() references result, which is local only to the other entry points. I reproduced it on 41d23708 with a mocked successful child and an empty request directory. It raises NameError: name 'result' is not defined, so the ordinary and lease fixtures still lose the diagnosis. Please share require_request_part(work, capture.returncode) here and add a successful-child/missing-marker control. The default Mesh86 capture is asynchronous unless X2W_SYNC_MESH_REQUESTS=1, so the helper comment should describe both modes.

**@⁠R0Y00** on GitHub · 2026-12-02 16:41 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3872#pullrequestreview-6155095652) · **requested changes** The missing-marker path in `run()` references `result`, which is local only to the other entry points. I reproduced it on 41d23708 with a mocked successful child and an empty request directory. It raises `NameError: name 'result' is not defined`, so the ordinary and lease fixtures still lose the diagnosis. Please share `require_request_part(work, capture.returncode)` here and add a successful-child/missing-marker control. The default Mesh86 capture is asynchronous unless `X2W_SYNC_MESH_REQUESTS=1`, so the helper comment should describe both modes.
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-02 20:58 UTC · original · approved these changes

c1fa6f3d addresses my previous review. The ordinary and lease cases now use the same diagnostic helper as the heap and Texture1D cases. I reran the missing-marker control with a successful fixture process and only a 7-byte .ps86 part. The old path raised NameError; this head reports status 0, zero .m86 markers and the names and sizes of the existing parts. Independent Windows 11 build 26300, MSVC Debug ctest --preset dev --no-tests=error -j 1 --output-on-failure -R '^startup_indirect_mesh_cache_(heap_)?(warp|hardware)$' passed 4/4 on WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656.

**@⁠R0Y00** on GitHub · 2026-12-02 20:58 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3872#pullrequestreview-6158892208) · **approved these changes** `c1fa6f3d` addresses my previous review. The ordinary and lease cases now use the same diagnostic helper as the heap and Texture1D cases. I reran the missing-marker control with a successful fixture process and only a 7-byte `.ps86` part. The old path raised `NameError`; this head reports status 0, zero `.m86` markers and the names and sizes of the existing parts. Independent Windows 11 build 26300, MSVC Debug `ctest --preset dev --no-tests=error -j 1 --output-on-failure -R '^startup_indirect_mesh_cache_(heap_)?(warp|hardware)$'` passed 4/4 on WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656.
github-bot changed target branch from main to gh-pr/3872/base 2026-12-02 21:11:24 +00:00
github manually merged commit c1fa6f3d7b into gh-pr/3872/base 2026-12-02 21:11:26 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.