compile_dxil: invalidate a published manifest when sidecar content changes with an older timestamp #3137

Closed
lambirou wants to merge 2 commits from upstream-pr/3137 into codex/native-shader-modules
lambirou commented 2026-11-27 16:54:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T16:54:04Z.


Change

A watched pixel-input sidecar could change content while keeping a preserved or older timestamp. is_watch_request_pending compared only the sidecar mtime against the manifest, so the request stayed a cache hit and the stale accepted manifest kept being served.

The published manifest now records an FNV-1a digest of the sidecar bytes (<key>.psinh, over the .psin/.ps57in extension, length and content). The watch path writes it before the manifest, the batch graphics path writes the same file, and the watcher withdraws the manifest when the digest differs. Unchanged bytes stay a cache hit. Existing manifests without a digest are retranslated once.

Refs #3133. Refs #3091. Targets codex/native-shader-modules while #3091 is open.

Verification

Windows 10 Pro 26H2 build 26300.10075, MSVC 19.51, Windows SDK and DXC 10.0.26100.0. These checks are CPU-only.

Commit 2ce9f112 in native/stale-manifest-mtime.

cmake --build --preset dev --target compile_dxil
python -B tests/native_startup_request_cache_check.py controls out/build/dev/compile_dxil.exe "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.26100.0\\x64"
python -B tests/native_compile_dxil_watch_check.py out/build/dev/compile_dxil.exe "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.26100.0\\x64"
  • native_startup_request_cache controls: passed, including the new regressions:
    • unchanged .psin -> cache hit, manifest not rewritten;
    • contradictory .ps57in with an mtime older than the manifest -> manifest withdrawn, conflicting stream and slot-57 pixel entry records;
    • the same bytes with a newer mtime from a fresh publication -> same withdrawal and identical .fail content;
    • changed .psin with a preserved mtime -> manifest withdrawn (invalid pixel input description).
  • native_compile_dxil_watch: passed (--once controls, resume/recheck, live watch retry/skip/recovery, CLI negative controls).

Evidence and follow-up

The digest covers the sidecar extension, its length and its bytes, so moving bytes between .psin and .ps57in changes it. No public fixture or asset is added. The watch and batch paths share the same digest writer, so a cache built by either path is interoperable with the watcher.

Review update (2026-11-27, 13c7cfab)

Both R0Y00/pigalot findings are addressed.

  • pixel_sidecar_hash now resolves an .rtv marker to its base .psin path, the same path graphics_psin_path uses for the mtime check, and hashes the base .psin/.ps57in pair. A base sidecar change with an older or preserved mtime now withdraws the variant as well as the base.
  • The watch and batch paths hash the sidecars before translation and again before publishing. A change during compilation throws pixel input sidecar changed during compilation; no manifest or stage is published from the mismatched snapshot.
  • native_startup_request_cache_check.py now publishes a base plus req_<base>.rtv, then checks unchanged hits, an older-mtime conflicting .ps57in, a newer-mtime conflict, and a preserved-mtime .psin change. Both base and variant manifests must be withdrawn or restored together.

Verification at 13c7cfab, dev and release: native_compile_dxil_watch, native_startup_request_cache_controls and native_rtv_variant_controls pass 3/3. docs_links_check and bidi_controls_check pass. This PR keeps the .psinh identity; #3138 is the alternative .psdep implementation. CI is not triggered for this branch target; the local receipt is above.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5530242224 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3137). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T16:54:04Z. --- ## Change A watched pixel-input sidecar could change content while keeping a preserved or older timestamp. `is_watch_request_pending` compared only the sidecar mtime against the manifest, so the request stayed a cache hit and the stale accepted manifest kept being served. The published manifest now records an FNV-1a digest of the sidecar bytes (`<key>.psinh`, over the `.psin`/`.ps57in` extension, length and content). The watch path writes it before the manifest, the batch graphics path writes the same file, and the watcher withdraws the manifest when the digest differs. Unchanged bytes stay a cache hit. Existing manifests without a digest are retranslated once. Refs #3133. Refs #3091. Targets `codex/native-shader-modules` while #3091 is open. ## Verification Windows 10 Pro 26H2 build 26300.10075, MSVC 19.51, Windows SDK and DXC 10.0.26100.0. These checks are CPU-only. Commit `2ce9f112` in `native/stale-manifest-mtime`. ``` cmake --build --preset dev --target compile_dxil python -B tests/native_startup_request_cache_check.py controls out/build/dev/compile_dxil.exe "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.26100.0\\x64" python -B tests/native_compile_dxil_watch_check.py out/build/dev/compile_dxil.exe "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.26100.0\\x64" ``` - `native_startup_request_cache controls`: passed, including the new regressions: - unchanged `.psin` -> cache hit, manifest not rewritten; - contradictory `.ps57in` with an mtime older than the manifest -> manifest withdrawn, `conflicting stream and slot-57 pixel entry records`; - the same bytes with a newer mtime from a fresh publication -> same withdrawal and identical `.fail` content; - changed `.psin` with a preserved mtime -> manifest withdrawn (`invalid pixel input description`). - `native_compile_dxil_watch`: passed (`--once` controls, resume/recheck, live watch retry/skip/recovery, CLI negative controls). ## Evidence and follow-up The digest covers the sidecar extension, its length and its bytes, so moving bytes between `.psin` and `.ps57in` changes it. No public fixture or asset is added. The watch and batch paths share the same digest writer, so a cache built by either path is interoperable with the watcher. ## Review update (2026-11-27, `13c7cfab`) Both R0Y00/pigalot findings are addressed. - `pixel_sidecar_hash` now resolves an `.rtv` marker to its base `.psin` path, the same path `graphics_psin_path` uses for the mtime check, and hashes the base `.psin`/`.ps57in` pair. A base sidecar change with an older or preserved mtime now withdraws the variant as well as the base. - The watch and batch paths hash the sidecars before translation and again before publishing. A change during compilation throws `pixel input sidecar changed during compilation`; no manifest or stage is published from the mismatched snapshot. - `native_startup_request_cache_check.py` now publishes a base plus `req_<base>.rtv`, then checks unchanged hits, an older-mtime conflicting `.ps57in`, a newer-mtime conflict, and a preserved-mtime `.psin` change. Both base and variant manifests must be withdrawn or restored together. Verification at `13c7cfab`, dev and release: `native_compile_dxil_watch`, `native_startup_request_cache_controls` and `native_rtv_variant_controls` pass 3/3. `docs_links_check` and `bidi_controls_check` pass. This PR keeps the `.psinh` identity; #3138 is the alternative `.psdep` implementation. CI is not triggered for this branch target; the local receipt is above.
lambirou commented 2026-11-27 17:17:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T17:17:07Z.


Note: the Windows checks workflow triggers only for pull requests to main and cpp-migration, so this branch-targeted PR has no CI run. The complete local receipt is in the description.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7224235278 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3137#issuecomment-7224235278). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T17:17:07Z. --- Note: the Windows checks workflow triggers only for pull requests to `main` and `cpp-migration`, so this branch-targeted PR has no CI run. The complete local receipt is in the description.
lambirou commented 2026-11-27 18:10:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T18:10:55Z.


CI-equivalent smoke receipt for this branch-targeted PR. The pr preset used by the Windows workflow for pull requests to main was built and run locally on native/stale-manifest-mtime (2ce9f112) with the change applied.

cmake --preset dev
cmake --build --preset pr
ctest --preset pr --no-tests=error

41/41 passed, 0 failed (20.4 s). The 12 spirv_*_warp tests are capability skips because SPIR-V tools are not installed on this host; they are skipped, not failed. Windows build 10.0.26300.10075, WARP. The two targeted watch checks remain as described in the PR.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7225214376 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3137#issuecomment-7225214376). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T18:10:55Z. --- CI-equivalent smoke receipt for this branch-targeted PR. The `pr` preset used by the Windows workflow for pull requests to main was built and run locally on `native/stale-manifest-mtime` (`2ce9f112`) with the change applied. ``` cmake --preset dev cmake --build --preset pr ctest --preset pr --no-tests=error ``` 41/41 passed, 0 failed (20.4 s). The 12 `spirv_*_warp` tests are capability skips because SPIR-V tools are not installed on this host; they are skipped, not failed. Windows build 10.0.26300.10075, WARP. The two targeted watch checks remain as described in the PR.
lambirou commented 2026-11-27 18:13:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T18:13:04Z.


Migration impact measured on the reference rev-29 cache, to answer the expected review question.

The cache at out/startup/shader_cache holds 520 published manifests, 0 .psin/.ps57in sidecars and 0 .psdep files. With this change, pixel_sidecar_hash returns false for those entries, sidecar_changed stays false, and the original mtime path applies unchanged: every published entry with both stage blobs stays a cache hit. Nothing is retranslated on that cache.

A manifest that does have a sidecar and no <key>.psinh is retranslated once (the conservative case for a pre-fix entry), after which the digest is published and unchanged inputs hit.

Note for context: that cache also carries 5,365 .fail files; --once retries failed requests by design (skip_failed is only set in continuous mode), which is unrelated to this change.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7225253303 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3137#issuecomment-7225253303). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T18:13:04Z. --- Migration impact measured on the reference rev-29 cache, to answer the expected review question. The cache at `out/startup/shader_cache` holds 520 published manifests, **0 `.psin`/`.ps57in` sidecars and 0 `.psdep` files**. With this change, `pixel_sidecar_hash` returns false for those entries, `sidecar_changed` stays false, and the original mtime path applies unchanged: every published entry with both stage blobs stays a cache hit. Nothing is retranslated on that cache. A manifest that does have a sidecar and no `<key>.psinh` is retranslated once (the conservative case for a pre-fix entry), after which the digest is published and unchanged inputs hit. Note for context: that cache also carries 5,365 `.fail` files; `--once` retries failed requests by design (`skip_failed` is only set in continuous mode), which is unrelated to this change.
R0Y00 commented 2026-11-27 21:21:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T21:21:57Z.

Review: CHANGES_REQUESTED


Two paths still allow a stale manifest by code inspection. In is_watch_request_pending, graphics_psin_path(req.marker) correctly resolves an .rtv request to the base sidecar for the mtime check, but pixel_sidecar_hash(req.marker, ...) hashes paths beside the variant marker itself. An older or preserved-mtime change on the base .psin/.ps57in can therefore keep an RTV variant as a cache hit. Please run the same invalidation control for both the base and a published .rtv variant.

The watch and batch writers also hash fresh filesystem reads after compiling from input.pixel_entry. If a sidecar changes during compilation, a digest of the new bytes can be published next to DXIL made from the old bytes. Persist an identity from the same snapshot that was validated and compiled, or verify that the new read matches that snapshot before publishing. #3138 uses the existing .psdep from the parsed request and has a base-plus-RTV control. Please coordinate so the shared watcher fix lands once while preserving both contributors’ test evidence.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6093448044 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3137#pullrequestreview-6093448044). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-27T21:21:57Z. **Review:** CHANGES_REQUESTED --- Two paths still allow a stale manifest by code inspection. In `is_watch_request_pending`, `graphics_psin_path(req.marker)` correctly resolves an `.rtv` request to the base sidecar for the mtime check, but `pixel_sidecar_hash(req.marker, ...)` hashes paths beside the variant marker itself. An older or preserved-mtime change on the base `.psin`/`.ps57in` can therefore keep an RTV variant as a cache hit. Please run the same invalidation control for both the base and a published `.rtv` variant. The watch and batch writers also hash fresh filesystem reads after compiling from `input.pixel_entry`. If a sidecar changes during compilation, a digest of the new bytes can be published next to DXIL made from the old bytes. Persist an identity from the same snapshot that was validated and compiled, or verify that the new read matches that snapshot before publishing. #3138 uses the existing `.psdep` from the parsed request and has a base-plus-RTV control. Please coordinate so the shared watcher fix lands once while preserving both contributors’ test evidence.
pigalot commented 2026-11-27 21:23:34 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T21:23:34Z.

Review: CHANGES_REQUESTED


I reviewed 2ce9f112 merged over current codex/native-shader-modules a48d39dc, the PR's base. The merge is clean and git diff --cached --check is clean. #3138 fixes the same issue (#3133) by comparing against .psdep, so I ran each PR's new regressions against the other's build.

What I ran. I built compile_dxil native_compute_pack_check native_frozen_request_check native_pixel_ir_dump native_compute_ir_dump in dev, then ran

ctest --test-dir out/build/dev --no-tests=error -j 1 -R '^(native_compile_dxil_watch|native_startup_request_cache_controls|native_rtv_variant_controls|native_direct_container|native_frozen_request)$'

5/5 pass.

Blocking: an RTV variant keeps a stale manifest. I ran #3138's tests/native_compile_dxil_watch_check.py against this build, and it fails in its RTV case:

  1. Publish a base req_<b>.a and an RTV variant req_<v>.rtv (put_graphics_request and put_variant), then run --once.
  2. Add a contradictory req_<b>.ps57in whose mtime is 60 s older than both manifests.
  3. Run --once again. The base is withdrawn (refused: conflicting stream and slot-57 pixel entry records), but <v>.txt is still served. The assert names variant.

The cause is that pixel_sidecar_hash(req.marker, ...) replaces the marker's own extension. For an .rtv marker that gives req_<v>.psin / req_<v>.ps57in, which never exist, so the digest step is skipped. A variant's sidecars are its base's, which is what graphics_psin_path resolves (and what the existing mtime check already uses). Hashing *graphics_psin_path(req.marker) in the pending check, and in compile_watch_item for variants, should close it. A variant case in native_startup_request_cache_check.py would pin it.

Cross-check the other way. #3138 also passes this PR's native_startup_request_cache_check.py regressions once the .psinh-file existence assert is removed (native_startup_request_cache_controls passes on #3138's build).

Non-blocking (not measured). The digest is computed from the sidecar on disk when the manifest is published, not from the bytes the compile read. If a sidecar is rewritten while a compile is running, the digest records the new bytes next to a manifest built from the old ones, and the stale manifest stays a cache hit. #3138 avoids this by comparing against .psdep, which is written from the description that was compiled.

Verdict: changes requested on 2ce9f112, for the RTV variant case. Since #3138 also passes this PR's four regressions, the branch owner may want to pick one of the two.

Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; DXC 1.9.2602.17; Python 3.12.10. These are CPU-only checks.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6093457422 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3137#pullrequestreview-6093457422). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-27T21:23:34Z. **Review:** CHANGES_REQUESTED --- I reviewed `2ce9f112` merged over current `codex/native-shader-modules` `a48d39dc`, the PR's base. The merge is clean and `git diff --cached --check` is clean. #3138 fixes the same issue (#3133) by comparing against `.psdep`, so I ran each PR's new regressions against the other's build. **What I ran.** I built `compile_dxil native_compute_pack_check native_frozen_request_check native_pixel_ir_dump native_compute_ir_dump` in `dev`, then ran ```powershell ctest --test-dir out/build/dev --no-tests=error -j 1 -R '^(native_compile_dxil_watch|native_startup_request_cache_controls|native_rtv_variant_controls|native_direct_container|native_frozen_request)$' ``` 5/5 pass. **Blocking: an RTV variant keeps a stale manifest.** I ran #3138's `tests/native_compile_dxil_watch_check.py` against this build, and it fails in its RTV case: 1. Publish a base `req_<b>.a` and an RTV variant `req_<v>.rtv` (`put_graphics_request` and `put_variant`), then run `--once`. 2. Add a contradictory `req_<b>.ps57in` whose mtime is 60 s older than both manifests. 3. Run `--once` again. The base is withdrawn (`refused: conflicting stream and slot-57 pixel entry records`), but `<v>.txt` is still served. The assert names `variant`. The cause is that `pixel_sidecar_hash(req.marker, ...)` replaces the marker's own extension. For an `.rtv` marker that gives `req_<v>.psin` / `req_<v>.ps57in`, which never exist, so the digest step is skipped. A variant's sidecars are its base's, which is what `graphics_psin_path` resolves (and what the existing mtime check already uses). Hashing `*graphics_psin_path(req.marker)` in the pending check, and in `compile_watch_item` for variants, should close it. A variant case in `native_startup_request_cache_check.py` would pin it. **Cross-check the other way.** #3138 also passes this PR's `native_startup_request_cache_check.py` regressions once the `.psinh`-file existence assert is removed (`native_startup_request_cache_controls` passes on #3138's build). **Non-blocking (not measured).** The digest is computed from the sidecar on disk when the manifest is published, not from the bytes the compile read. If a sidecar is rewritten while a compile is running, the digest records the new bytes next to a manifest built from the old ones, and the stale manifest stays a cache hit. #3138 avoids this by comparing against `.psdep`, which is written from the description that was compiled. **Verdict:** changes requested on `2ce9f112`, for the RTV variant case. Since #3138 also passes this PR's four regressions, the branch owner may want to pick one of the two. Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; DXC 1.9.2602.17; Python 3.12.10. These are CPU-only checks. This reply was AI-assisted.
lambirou commented 2026-11-27 22:16:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T22:16:48Z.


Review update (2026-11-27, 13c7cfab)

Both R0Y00/pigalot findings are addressed.

  • pixel_sidecar_hash now resolves an .rtv marker to its base .psin path, the same path graphics_psin_path uses for the mtime check, and hashes the base .psin/.ps57in pair. A base sidecar change with an older or preserved mtime now withdraws the variant as well as the base.
  • The watch and batch paths hash the sidecars before translation and again before publishing. A change during compilation throws pixel input sidecar changed during compilation; no manifest or stage is published from the mismatched snapshot.
  • native_startup_request_cache_check.py now publishes a base plus req_<base>.rtv, then checks unchanged hits, an older-mtime conflicting .ps57in, a newer-mtime conflict, and a preserved-mtime .psin change. Both base and variant manifests must be withdrawn or restored together.

Verification at 13c7cfab, dev and release: native_compile_dxil_watch, native_startup_request_cache_controls and native_rtv_variant_controls pass 3/3. docs_links_check and bidi_controls_check pass. This PR keeps the .psinh identity; #3138 is the alternative .psdep implementation. CI is not triggered for this branch target; the local receipt is above.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7229188044 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3137#issuecomment-7229188044). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T22:16:48Z. --- ## Review update (2026-11-27, `13c7cfab`) Both R0Y00/pigalot findings are addressed. - `pixel_sidecar_hash` now resolves an `.rtv` marker to its base `.psin` path, the same path `graphics_psin_path` uses for the mtime check, and hashes the base `.psin`/`.ps57in` pair. A base sidecar change with an older or preserved mtime now withdraws the variant as well as the base. - The watch and batch paths hash the sidecars before translation and again before publishing. A change during compilation throws `pixel input sidecar changed during compilation`; no manifest or stage is published from the mismatched snapshot. - `native_startup_request_cache_check.py` now publishes a base plus `req_<base>.rtv`, then checks unchanged hits, an older-mtime conflicting `.ps57in`, a newer-mtime conflict, and a preserved-mtime `.psin` change. Both base and variant manifests must be withdrawn or restored together. Verification at `13c7cfab`, dev and release: `native_compile_dxil_watch`, `native_startup_request_cache_controls` and `native_rtv_variant_controls` pass 3/3. `docs_links_check` and `bidi_controls_check` pass. This PR keeps the `.psinh` identity; #3138 is the alternative `.psdep` implementation. CI is not triggered for this branch target; the local receipt is above.
lambirou commented 2026-11-27 22:19:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T22:19:30Z.


@R0Y00 @pigalot the base-sidecar digest for .rtv variants and the pre/post-compile snapshot check are on 13c7cfab; the request-cache control now covers the variant. Could you re-review?

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7229229790 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3137#issuecomment-7229229790). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T22:19:30Z. --- @R0Y00 @pigalot the base-sidecar digest for `.rtv` variants and the pre/post-compile snapshot check are on `13c7cfab`; the request-cache control now covers the variant. Could you re-review?
lambirou commented 2026-11-27 22:25:26 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T22:25:26Z.


#3138 is now approved by both reviewers and covers the same base-plus-.rtv invalidation using .psdep. This branch carries the equivalent fix and variant regression on 13c7cfab, but it is the duplicate implementation. I am leaving it open for R0Y00 to choose which one lands; no further code changes are needed here.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7229315548 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3137#issuecomment-7229315548). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T22:25:26Z. --- #3138 is now approved by both reviewers and covers the same base-plus-`.rtv` invalidation using `.psdep`. This branch carries the equivalent fix and variant regression on `13c7cfab`, but it is the duplicate implementation. I am leaving it open for R0Y00 to choose which one lands; no further code changes are needed here.
pigalot commented 2026-11-27 22:30:26 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T22:30:26Z.

Review: APPROVED


Re-reviewed 13c7cfab merged over current codex/native-shader-modules a48d39dc, the PR's base. The merge is clean and git diff --cached --check is clean.

The blocking finding from my review of 2ce9f112 is fixed. For an .rtv marker, pixel_sidecar_hash now hashes the base's sidecars through graphics_psin_path. The request-cache control has a variant case.

The non-blocking note is addressed too. Both the watch path (compile_watch_item) and the batch path now hash the sidecars before reading the request and again after both compiles. If the two hashes differ, the step throws and no manifest is published (the watch path also removes the stale one). The digest written to .psinh is the one taken before the read.

What I ran. I built compile_dxil native_compute_pack_check native_frozen_request_check native_pixel_ir_dump native_compute_ir_dump in dev, then ran

ctest --test-dir out/build/dev --no-tests=error -j 1 -R '^(native_compile_dxil_watch|native_startup_request_cache_controls|native_rtv_variant_controls|native_direct_container|native_frozen_request)$'

5/5 pass.

Cross-check. #3138's tests/native_compile_dxil_watch_check.py (the RTV case that failed on 2ce9f112) now passes against this build. With the cross-check the other way from my first review, each PR's regressions pass on the other's build.

Mutants in tools/startup/compile_dxil.cpp. For each, I rebuilt compile_dxil in dev and ran the same 5 tests:

Mutant Result
.rtv marker hashes its own (missing) sidecars again killed (native_startup_request_cache_controls)
watch path skips the before/after comparison survives
watch path publishes the after-compile digest survives, equivalent while the comparison stands (the two digests are equal)

Restored and rebuilt afterwards; git diff --quiet is clean.

Non-blocking. The before/after comparison isn't pinned, because no test rewrites a sidecar while a compile is running. That's hard to do deterministically, and the code is small and reads correctly. I'm only noting it as unmeasured.

Verdict: approve on 13c7cfab. This PR and #3138 now both fix #3133, so as lambirou says, it's for R0Y00 to pick which one lands. R0Y00's changes request on 2ce9f112 still stands, and the base is a codex/* branch, so this is review only.

Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; DXC 1.9.2602.17; Python 3.12.10. These are CPU-only checks.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6093965812 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3137#pullrequestreview-6093965812). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-27T22:30:26Z. **Review:** APPROVED --- Re-reviewed `13c7cfab` merged over current `codex/native-shader-modules` `a48d39dc`, the PR's base. The merge is clean and `git diff --cached --check` is clean. **The blocking finding from my review of `2ce9f112` is fixed.** For an `.rtv` marker, `pixel_sidecar_hash` now hashes the base's sidecars through `graphics_psin_path`. The request-cache control has a variant case. **The non-blocking note is addressed too.** Both the watch path (`compile_watch_item`) and the batch path now hash the sidecars before reading the request and again after both compiles. If the two hashes differ, the step throws and no manifest is published (the watch path also removes the stale one). The digest written to `.psinh` is the one taken before the read. **What I ran.** I built `compile_dxil native_compute_pack_check native_frozen_request_check native_pixel_ir_dump native_compute_ir_dump` in `dev`, then ran ```powershell ctest --test-dir out/build/dev --no-tests=error -j 1 -R '^(native_compile_dxil_watch|native_startup_request_cache_controls|native_rtv_variant_controls|native_direct_container|native_frozen_request)$' ``` 5/5 pass. **Cross-check.** #3138's `tests/native_compile_dxil_watch_check.py` (the RTV case that failed on `2ce9f112`) now passes against this build. With the cross-check the other way from my first review, each PR's regressions pass on the other's build. **Mutants** in `tools/startup/compile_dxil.cpp`. For each, I rebuilt `compile_dxil` in `dev` and ran the same 5 tests: | Mutant | Result | |---|---| | `.rtv` marker hashes its own (missing) sidecars again | killed (`native_startup_request_cache_controls`) | | watch path skips the before/after comparison | **survives** | | watch path publishes the after-compile digest | survives, equivalent while the comparison stands (the two digests are equal) | Restored and rebuilt afterwards; `git diff --quiet` is clean. **Non-blocking.** The before/after comparison isn't pinned, because no test rewrites a sidecar while a compile is running. That's hard to do deterministically, and the code is small and reads correctly. I'm only noting it as unmeasured. **Verdict:** approve on `13c7cfab`. This PR and #3138 now both fix #3133, so as lambirou says, it's for R0Y00 to pick which one lands. R0Y00's changes request on `2ce9f112` still stands, and the base is a `codex/*` branch, so this is review only. Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; DXC 1.9.2602.17; Python 3.12.10. These are CPU-only checks. This reply was AI-assisted.
lambirou commented 2026-11-27 22:31:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T22:31:55Z.


@R0Y00 pigalot approved 13c7cfab at 22:30:26, and #3138 is also approved by both of you. Both now pass each other's RTV/base-sidecar regressions. Which implementation do you want to land? If #3138 is the choice, I can close this duplicate; if #3137 is the choice, the pending CHANGES_REQUESTED can be cleared.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7229405510 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3137#issuecomment-7229405510). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T22:31:55Z. --- @R0Y00 pigalot approved `13c7cfab` at 22:30:26, and [#3138](https://github.com/R0Y00/Xbox2Windows/pull/3138) is also approved by both of you. Both now pass each other's RTV/base-sidecar regressions. Which implementation do you want to land? If #3138 is the choice, I can close this duplicate; if #3137 is the choice, the pending CHANGES_REQUESTED can be cleared.
KelboLive commented 2026-11-27 23:56:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-27T23:56:25Z.


Agree with both APPROVED reviews: FNV-1a sidecar digest in .psinh is a clean approach — the watch path and batch path share the same writer, so cache built by either path is interoperable. RTV variant case fixed (hashes base's sidecars through graphics_psin_path). Before/after comparison during compilation addresses stale-during-compile edge case.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7230521992 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3137#issuecomment-7230521992). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-27T23:56:25Z. --- Agree with both APPROVED reviews: FNV-1a sidecar digest in `.psinh` is a clean approach — the watch path and batch path share the same writer, so cache built by either path is interoperable. RTV variant case fixed (hashes base's sidecars through `graphics_psin_path`). Before/after comparison during compilation addresses stale-during-compile edge case.
JohnConnorNPC commented 2026-11-28 07:52:26 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-28T07:52:26Z.


Thank you for this work, and for offering to close it if #3138 was the choice. #3138 fixes the same stale-manifest case on the same base and merged at 2026-11-28T06:15Z, so I'm closing this as its duplicate.

  • git merge-base --is-ancestor 0b505c1c origin/codex/native-shader-modules succeeds: #3138's merge is in the base.
  • git merge-tree --write-tree origin/codex/native-shader-modules 13c7cfab exits 1 with CONFLICT (content): Merge conflict in tools/startup/compile_dxil.cpp (1 hunk, in the batch path).
  • In that trial merge, is_watch_request_pending auto-merges both mechanisms. The inner bool sidecar_changed = false; (.psinh) shadows #3138's outer one (.psdep), so recheck = sidecar_changed && has_manifest never sees a .psinh mismatch.

One part is still worth having on the base: section 7's check that an unchanged RTV variant stays a cache hit (assert variant_manifest.stat().st_mtime_ns == variant_ns). The base test has no equivalent (grep -c variant_ns → 0). A small follow-up that ports it would be very welcome.

This comment was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7236216063 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3137#issuecomment-7236216063). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-28T07:52:26Z. --- Thank you for this work, and for offering to close it if #3138 was the choice. #3138 fixes the same stale-manifest case on the same base and merged at 2026-11-28T06:15Z, so I'm closing this as its duplicate. - `git merge-base --is-ancestor 0b505c1c origin/codex/native-shader-modules` succeeds: #3138's merge is in the base. - `git merge-tree --write-tree origin/codex/native-shader-modules 13c7cfab` exits 1 with `CONFLICT (content): Merge conflict in tools/startup/compile_dxil.cpp` (1 hunk, in the batch path). - In that trial merge, `is_watch_request_pending` auto-merges both mechanisms. The inner `bool sidecar_changed = false;` (`.psinh`) shadows #3138's outer one (`.psdep`), so `recheck = sidecar_changed && has_manifest` never sees a `.psinh` mismatch. One part is still worth having on the base: section 7's check that an unchanged RTV variant stays a cache hit (`assert variant_manifest.stat().st_mtime_ns == variant_ns`). The base test has no equivalent (`grep -c variant_ns` → 0). A small follow-up that ports it would be very welcome. This comment was AI-assisted.

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!3137
No description provided.