gfx2hlsl: lower 2D depth-comparison image sampling (image_sample_c, image_sample_c_lz) #1471

Manually merged
github merged 4 commits from gh-pr/1471/head into gh-pr/1471/base 2026-11-26 23:09:50 +00:00
Owner

@⁠tedin7 on GitHub · 2026-11-24 12:17 UTC · original
tedin7:x2w-frontier-gfx2-sample-c → main · +601 −7 · 7 files · 4 commits · merged 2026-11-24 13:48 UTC

Change

tools/startup/gfx2hlsl.py lowers the gfx1013 image_sample_c_lz and image_sample_c forms of a 2D texture (dmask:0x1) to SampleCmpLevelZero (and SampleCmp for image_sample_c in a pixel stage with a known execution mask and no branches). The first address register is the reference, then u and v. The sampler words must pass the existing pixel_aot.comparison_sampler_state profile; the sampler is declared as a SamplerComparisonState and listed as an smpc N w0 w1 w2 w3 manifest line. src/startup_stubs/translated_sampler_bindings.h builds the matching comparison static sampler (filter 0x80 or 0x94, function = hardware function + 1) and keeps manifest order as register order.

image_sample_c_l is refused (HLSL has no SampleCmpLevel before shader model 6.7; the stages compile as 5.1 and 6.0). Array, 3D, cube and 1D images, other dmask values, offset/bias/clamp/gather forms, a16/d16/tfe/lwe/r128/unorm, reserved MIMG bits, run-time heap samplers and samplers outside the checked profile are refused with their own message.

Draft: a D3D12 readback of a gfx2hlsl.py comparison draw is not part of this PR (see Evidence and follow-up).

Verification

AI-assisted; commands listed were executed locally (Linux, Python 3, LLVM 15.0.6 extracted from the Debian package into a temporary folder, and LLVM 19).

  • python3 -B tests/startup_image_sample_c_check.py: all controls and 7 mutants pass/fail as expected.
  • python3 -B tests/startup_image_sample_c_check.py binary llvm-mc-15 and ... binary llvm-mc-19: fixture words match llvm-mc (every recorded fixture, both LLVM versions).
  • Same test on origin/main (detached copy of main): fails with gfx2hlsl.Unsupported: image_sample_c_lz.
  • x86_64-w64-mingw32-g++ -std=c++17 -Wall -Wextra of tests/startup_sampler_comparison_check.cpp, run under Wine: startup_sampler_comparison ok. Mutating the header (function offset, filter reduction, smpc parsing) makes it print FAIL for each.
  • tests/startup_image_sample_l_check.py, startup_image_3d_check.py, startup_image_load_mip_check.py, startup_image_2d_array_check.py, startup_flat_param_check.py, startup_gfx2hlsl_bit_alu_check.py, startup_gfx2hlsl_sdwa_check.py, startup_inline_sampler_check.py, startup_sampler_heap_check.py, startup_translator_check.py, docs_links_check.py, bidi_controls_check.py: pass. rdna2_tools_check.py with LLVM 15: OK (skipped=1). py_compile and git diff --check: clean.
  • Not run here (no Windows host): the MSVC build of the new executable and ctest --preset dev --no-tests=error -R '^(startup_image_sample_c|startup_sampler_comparison)$' -V (outside --preset pr; Debug and /O2).

Evidence and follow-up

  • Fixtures are source-built gfx1013 assembly in the test; nothing is copied from a game or a dump.
  • Order of the address registers: the contiguous form v[0:2] reads the reference from v0, the NSA form [v3, v0, v1] reads it from v3. The same image_sample_c_lz order and the same HLSL call are already read back on WARP for the pixel AOT path by tests/pixel_compare_check.py.
  • Missing: a WARP/hardware draw that runs the gfx2hlsl.py output with an smpc sampler on an R32_FLOAT texture and checks exact 1.0/0.0 per comparison function. Also open: 2D array comparisons and image_sample_c_l (needs a proven constant level 0 or shader model 6.7).
  • Overlap: touches CMakeLists.txt, docs/experiments.md and windows.yml only with appended entries; tools/startup/gfx2hlsl.py hunks are separate from #1430 (a merge of both is clean).

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.
**@⁠tedin7** on GitHub · 2026-11-24 12:17 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1471) `tedin7:x2w-frontier-gfx2-sample-c` → `main` · +601 −7 · 7 files · 4 commits · merged 2026-11-24 13:48 UTC ## Change `tools/startup/gfx2hlsl.py` lowers the gfx1013 `image_sample_c_lz` and `image_sample_c` forms of a 2D texture (`dmask:0x1`) to `SampleCmpLevelZero` (and `SampleCmp` for `image_sample_c` in a pixel stage with a known execution mask and no branches). The first address register is the reference, then u and v. The sampler words must pass the existing `pixel_aot.comparison_sampler_state` profile; the sampler is declared as a `SamplerComparisonState` and listed as an `smpc N w0 w1 w2 w3` manifest line. `src/startup_stubs/translated_sampler_bindings.h` builds the matching comparison static sampler (filter 0x80 or 0x94, function = hardware function + 1) and keeps manifest order as register order. `image_sample_c_l` is refused (HLSL has no `SampleCmpLevel` before shader model 6.7; the stages compile as 5.1 and 6.0). Array, 3D, cube and 1D images, other `dmask` values, offset/bias/clamp/gather forms, `a16`/`d16`/`tfe`/`lwe`/`r128`/`unorm`, reserved MIMG bits, run-time heap samplers and samplers outside the checked profile are refused with their own message. Draft: a D3D12 readback of a `gfx2hlsl.py` comparison draw is not part of this PR (see Evidence and follow-up). ## Verification AI-assisted; commands listed were executed locally (Linux, Python 3, LLVM 15.0.6 extracted from the Debian package into a temporary folder, and LLVM 19). - `python3 -B tests/startup_image_sample_c_check.py`: all controls and 7 mutants pass/fail as expected. - `python3 -B tests/startup_image_sample_c_check.py binary llvm-mc-15` and `... binary llvm-mc-19`: `fixture words match llvm-mc` (every recorded fixture, both LLVM versions). - Same test on `origin/main` (detached copy of main): fails with `gfx2hlsl.Unsupported: image_sample_c_lz`. - `x86_64-w64-mingw32-g++ -std=c++17 -Wall -Wextra` of `tests/startup_sampler_comparison_check.cpp`, run under Wine: `startup_sampler_comparison ok`. Mutating the header (function offset, filter reduction, `smpc` parsing) makes it print `FAIL` for each. - `tests/startup_image_sample_l_check.py`, `startup_image_3d_check.py`, `startup_image_load_mip_check.py`, `startup_image_2d_array_check.py`, `startup_flat_param_check.py`, `startup_gfx2hlsl_bit_alu_check.py`, `startup_gfx2hlsl_sdwa_check.py`, `startup_inline_sampler_check.py`, `startup_sampler_heap_check.py`, `startup_translator_check.py`, `docs_links_check.py`, `bidi_controls_check.py`: pass. `rdna2_tools_check.py` with LLVM 15: `OK (skipped=1)`. `py_compile` and `git diff --check`: clean. - Not run here (no Windows host): the MSVC build of the new executable and `ctest --preset dev --no-tests=error -R '^(startup_image_sample_c|startup_sampler_comparison)$' -V` (outside `--preset pr`; Debug and /O2). ## Evidence and follow-up - Fixtures are source-built gfx1013 assembly in the test; nothing is copied from a game or a dump. - Order of the address registers: the contiguous form `v[0:2]` reads the reference from `v0`, the NSA form `[v3, v0, v1]` reads it from `v3`. The same `image_sample_c_lz` order and the same HLSL call are already read back on WARP for the pixel AOT path by `tests/pixel_compare_check.py`. - Missing: a WARP/hardware draw that runs the `gfx2hlsl.py` output with an `smpc` sampler on an R32_FLOAT texture and checks exact 1.0/0.0 per comparison function. Also open: 2D array comparisons and `image_sample_c_l` (needs a proven constant level 0 or shader model 6.7). - Overlap: touches `CMakeLists.txt`, `docs/experiments.md` and `windows.yml` only with appended entries; `tools/startup/gfx2hlsl.py` hunks are separate from #1430 (a merge of both is clean). ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets.
The reference is the first address register. The sampler becomes a SamplerComparisonState listed as an smpc manifest line, and the runtime builds the matching comparison static sampler. image_sample_c_l is refused: SampleCmpLevel needs shader model 6.7. AI-assisted; commands listed were executed locally.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:09:47 +00:00
github manually merged commit d21e3d6e1a into gh-pr/1471/base 2026-11-26 23:09:50 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 12:26 UTC · original

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 5b91c08744114cde5789189dc0fa152461dde4f9:

  • Debug (--preset dev): ctest --preset dev -R '^(startup_sampler_comparison|startup_image_sample_c)$' --no-tests=error --output-on-failure: 2/2 passed
  • Release /O2 (--preset release): same selection: 2/2 passed

Linux: git diff --check, docs_links_check.py, bidi_controls_check.py and x2w_pipe.py preflight pass.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-24 12:26 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1471#issuecomment-7131443542) Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `5b91c08744114cde5789189dc0fa152461dde4f9`: - **Debug (`--preset dev`)**: `ctest --preset dev -R '^(startup_sampler_comparison|startup_image_sample_c)$' --no-tests=error --output-on-failure`: **2/2 passed** - **Release `/O2` (`--preset release`)**: same selection: **2/2 passed** Linux: `git diff --check`, `docs_links_check.py`, `bidi_controls_check.py` and `x2w_pipe.py preflight` pass. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 12:26 UTC · original · edited 2026-11-24 12:31 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-11-24T12:31:41.963440Z 5b91c08 Draft marked ready
ℹ️ 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-11-24 12:26 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1471#issuecomment-7131447885) · edited 2026-11-24 12:31 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"5b91c08744114cde5789189dc0fa152461dde4f9","has_any_findings":true,"has_unresolved_findings":true,"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-11-24T12:31:41.963440Z">2026-11-24T12:31:41.963440Z</relative-time> | `5b91c08` | Draft marked ready | <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

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 12:31 UTC · original

P2 Badge Preserve MAX_LOD for implicit depth comparisons

When image_sample_c samples a minified, mipmapped texture with MAX_LOD == 0 (for example, the accepted sampler w1 = 0, w2 = 1 << 26), this emits a derivative-based SampleCmp without preserving that limit. pixel_aot.comparison_sampler_state() deliberately ignores MAX_LOD because its profile validates LOD-zero sampling, while translated_sampler_bindings.h::decode_sampler() always sets MaxLOD to D3D12_FLOAT32_MAX. The source therefore samples mip 0 while the translation can compare against a higher mip, producing different comparison results when the mip contents differ. Decode and enforce the limit for implicit comparisons, or refuse that form until an appropriate sampler profile is supported.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 12:31 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1471#discussion_r4680010525) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Preserve MAX_LOD for implicit depth comparisons** When `image_sample_c` samples a minified, mipmapped texture with `MAX_LOD == 0` (for example, the accepted sampler `w1 = 0, w2 = 1 << 26`), this emits a derivative-based `SampleCmp` without preserving that limit. `pixel_aot.comparison_sampler_state()` deliberately ignores `MAX_LOD` because its profile validates LOD-zero sampling, while `translated_sampler_bindings.h::decode_sampler()` always sets `MaxLOD` to `D3D12_FLOAT32_MAX`. The source therefore samples mip 0 while the translation can compare against a higher mip, producing different comparison results when the mip contents differ. Decode and enforce the limit for implicit comparisons, or refuse that form until an appropriate sampler profile is supported. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 12:43 UTC · original

Fixed in 8ae3c180: an implicit comparison now reads MAX_LOD (word 1 bits 23:12). A limit of 0 lowers to SampleCmpLevelZero, which is exact. The unlimited value keeps SampleCmp. Any other limit is refused, because the static sampler cannot carry it. New fixtures c_max0 and c_max_partial in tests/startup_image_sample_c_check.py cover both cases.

**@⁠tedin7** on GitHub · 2026-11-24 12:43 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1471#discussion_r4680139204) Fixed in 8ae3c180: an implicit comparison now reads MAX_LOD (word 1 bits 23:12). A limit of 0 lowers to SampleCmpLevelZero, which is exact. The unlimited value keeps SampleCmp. Any other limit is refused, because the static sampler cannot carry it. New fixtures c_max0 and c_max_partial in tests/startup_image_sample_c_check.py cover both cases.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 13:13 UTC · original

Fixed in d9e27f68: image_compare now refuses an implicit image_sample_c with unrestricted MAX_LOD when its derivatives cannot be represented (exec not proven, or inside a block), instead of falling through to SampleCmpLevelZero. Proven MAX_LOD=0 still lowers to SampleCmpLevelZero, and the proven pixel-stage unrestricted form still lowers to SampleCmp. I did not add a two-mip draw test; the unrestricted SampleCmp form stays limited to the cases where the derivatives are proven.

Regression test in tests/startup_image_sample_c_check.py: both implicit fixtures (c, c_nsa) are refused in the exec-uncertain and in-block cases, and c_max0 stays SampleCmpLevelZero in both.

Win2025 startup_sampler_comparison and startup_image_sample_c on d9e27f68:

  • Debug (--preset dev): 2/2 passed.
  • Release /O2 (--preset release): 2/2 passed.
**@⁠tedin7** on GitHub · 2026-11-24 13:13 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1471#issuecomment-7132531810) Fixed in d9e27f68: `image_compare` now refuses an implicit `image_sample_c` with unrestricted MAX_LOD when its derivatives cannot be represented (exec not proven, or inside a block), instead of falling through to `SampleCmpLevelZero`. Proven MAX_LOD=0 still lowers to `SampleCmpLevelZero`, and the proven pixel-stage unrestricted form still lowers to `SampleCmp`. I did not add a two-mip draw test; the unrestricted `SampleCmp` form stays limited to the cases where the derivatives are proven. Regression test in `tests/startup_image_sample_c_check.py`: both implicit fixtures (`c`, `c_nsa`) are refused in the exec-uncertain and in-block cases, and `c_max0` stays `SampleCmpLevelZero` in both. Win2025 `startup_sampler_comparison` and `startup_image_sample_c` on d9e27f68: - Debug (`--preset dev`): 2/2 passed. - Release `/O2` (`--preset release`): 2/2 passed.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 13:36 UTC · original

Fixed in d21e3d6e: unrestricted implicit image_sample_c is kept out of this slice. image_sample_c is lowered to SampleCmpLevelZero only when the sampler MAX_LOD is 0 (exact level zero); any other MAX_LOD is refused as implicit mip selection, so the SampleCmp branch and its mip-filter-ignoring mapping are gone. tests/startup_image_sample_c_check.py now requires c, c_nsa and the partial-MAX_LOD form to be refused and keeps the MAX_LOD 0 lowering; docs/experiments.md is updated.

Win2025 at d21e3d6e: Debug (dev) startup_sampler_comparison + startup_image_sample_c 2/2 passed; Release /O2 2/2 passed.

**@⁠tedin7** on GitHub · 2026-11-24 13:36 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1471#issuecomment-7133073188) Fixed in d21e3d6e: unrestricted implicit image_sample_c is kept out of this slice. image_sample_c is lowered to SampleCmpLevelZero only when the sampler MAX_LOD is 0 (exact level zero); any other MAX_LOD is refused as implicit mip selection, so the SampleCmp branch and its mip-filter-ignoring mapping are gone. tests/startup_image_sample_c_check.py now requires c, c_nsa and the partial-MAX_LOD form to be refused and keeps the MAX_LOD 0 lowering; docs/experiments.md is updated. Win2025 at d21e3d6e: Debug (dev) startup_sampler_comparison + startup_image_sample_c 2/2 passed; Release /O2 2/2 passed.
Author
Owner

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

The reference ordering and the comparison call are both covered

Independent reviewer, not the author. Reviewed the current head; nothing pushed to the branch. Mutations were made
locally in tools/startup/gfx2hlsl.py, reverted between each; working tree is clean.

Environment: Windows 11 build 26300.9974, MSVC 14.44.35207, SDK 10.0.26100, DXC 1.8.2502.11, LLVM gfx1013 tooling
available, RTX 5080 Laptop (32.0.15.8142) for _hardware.

cmake --preset dev
cmake --build --preset dev
ctest --preset dev --no-tests=error -R 'sample_c|comparison' -V
startup_sampler_comparison ....... Passed  0.14 s
startup_image_sample_c ........... Passed  0.92 s
pixel_aot_comparisons_hardware ... Passed 41.49 s
pixel_aot_comparisons_warp ....... Passed 11.56 s

Mutation A — the address dwords are unpacked in the wrong order

The lowering builds SampleCmpLevelZero(smp, float2(u, v), reference) from cs[1], cs[2] and cs[0]. Taking the
dwords in file order instead:

-    args = '%s, float2(%s, %s), %s' % (smp, self.f(cs[1]), self.f(cs[2]), self.f(cs[0]))
+    args = '%s, float2(%s, %s), %s' % (smp, self.f(cs[0]), self.f(cs[1]), self.f(cs[2]))
startup_image_sample_c ........... ***Failed
startup_sampler_comparison ....... Passed

So the fixture notices that the reference is the first address dword rather than the first argument slot — which is the
easy mistake to make here, since the HLSL call order is the reverse of the word order.

Mutation B — the comparison call degrades to a plain sample

-    call = '%s.SampleCmpLevelZero(%s)' % (tex, args)
+    call = '%s.SampleLevel(%s), 0)' % (tex, args)
startup_image_sample_c ........... ***Failed

The comparison itself is asserted, not just "a sample happened".

What this does not say

startup_sampler_comparison stays green under mutation A because it checks the static-sampler mapping, not the call
site; that is consistent with its name, and I mention it so the two fixtures' division of labour is explicit.

The refusal paths (image_sample_c_l needing SM 6.7, c with a non-zero MAX_LOD) I did not drive; they are Unsupported
raises and would need crafted sampler words.

Verdict

Reviewed the current head. Builds clean, all four cases pass across WARP and a physical adapter, and two independent
mutations in the emitted call are caught. No objection from me.

**@⁠ChazY11** on GitHub · 2026-11-24 15:11 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1471#issuecomment-7135619099) ## The reference ordering and the comparison call are both covered Independent reviewer, not the author. Reviewed the current head; nothing pushed to the branch. Mutations were made locally in `tools/startup/gfx2hlsl.py`, reverted between each; working tree is clean. Environment: Windows 11 build 26300.9974, MSVC 14.44.35207, SDK 10.0.26100, DXC 1.8.2502.11, LLVM gfx1013 tooling available, RTX 5080 Laptop (32.0.15.8142) for `_hardware`. ```powershell cmake --preset dev cmake --build --preset dev ctest --preset dev --no-tests=error -R 'sample_c|comparison' -V ``` ```text startup_sampler_comparison ....... Passed 0.14 s startup_image_sample_c ........... Passed 0.92 s pixel_aot_comparisons_hardware ... Passed 41.49 s pixel_aot_comparisons_warp ....... Passed 11.56 s ``` ### Mutation A — the address dwords are unpacked in the wrong order The lowering builds `SampleCmpLevelZero(smp, float2(u, v), reference)` from `cs[1]`, `cs[2]` and `cs[0]`. Taking the dwords in file order instead: ```diff - args = '%s, float2(%s, %s), %s' % (smp, self.f(cs[1]), self.f(cs[2]), self.f(cs[0])) + args = '%s, float2(%s, %s), %s' % (smp, self.f(cs[0]), self.f(cs[1]), self.f(cs[2])) ``` ```text startup_image_sample_c ........... ***Failed startup_sampler_comparison ....... Passed ``` So the fixture notices that the reference is the first address dword rather than the first argument slot — which is the easy mistake to make here, since the HLSL call order is the reverse of the word order. ### Mutation B — the comparison call degrades to a plain sample ```diff - call = '%s.SampleCmpLevelZero(%s)' % (tex, args) + call = '%s.SampleLevel(%s), 0)' % (tex, args) ``` ```text startup_image_sample_c ........... ***Failed ``` The comparison itself is asserted, not just "a sample happened". ### What this does not say `startup_sampler_comparison` stays green under mutation A because it checks the static-sampler mapping, not the call site; that is consistent with its name, and I mention it so the two fixtures' division of labour is explicit. The refusal paths (`image_sample_c_l` needing SM 6.7, `c` with a non-zero MAX_LOD) I did not drive; they are `Unsupported` raises and would need crafted sampler words. ### Verdict Reviewed the current head. Builds clean, all four cases pass across WARP and a physical adapter, and two independent mutations in the emitted call are caught. No objection from me.
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 12:31 UTC · original · reviewed

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5b91c08744

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback".

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 12:31 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1471#pullrequestreview-6039230644) · **reviewed** <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `5b91c08744` <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". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback". </details>
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 13:09 UTC · original · requested changes

Release passes the three translator/sampler checks. In image_compare, an implicit comparison with unrestricted MAX_LOD falls through to SampleCmpLevelZero when EXEC is uncertain or the sample is inside a block. This silently changes the selected mip. Please refuse that implicit form when its derivatives cannot be represented, while retaining explicit-zero and proven MAX_LOD=0. For the unrestricted branch, please establish the mip filter and chosen mip with two distinguishable mips in a source-built startup draw, or keep the first slice at proven LOD zero.

**@⁠R0Y00** on GitHub · 2026-11-24 13:09 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1471#pullrequestreview-6039757858) · **requested changes** Release passes the three translator/sampler checks. In image_compare, an implicit comparison with unrestricted MAX_LOD falls through to SampleCmpLevelZero when EXEC is uncertain or the sample is inside a block. This silently changes the selected mip. Please refuse that implicit form when its derivatives cannot be represented, while retaining explicit-zero and proven MAX_LOD=0. For the unrestricted branch, please establish the mip filter and chosen mip with two distinguishable mips in a source-built startup draw, or keep the first slice at proven LOD zero.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 13:25 UTC · original · reviewed

The new derivative refusal and three Release checks pass. The unrestricted mip branch still needs its own evidence: the comparison-state helper deliberately ignores the mip filter when mapping to the level-zero desktop profiles, and the shown runtime static sampler filters use point mip selection. Please keep unrestricted implicit sampling out of this slice or add the matched mip-filter mapping and a two-mip startup draw that fails on an incorrect mip or blend.

**@⁠R0Y00** on GitHub · 2026-11-24 13:25 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1471#pullrequestreview-6039986083) · **reviewed** The new derivative refusal and three Release checks pass. The unrestricted mip branch still needs its own evidence: the comparison-state helper deliberately ignores the mip filter when mapping to the level-zero desktop profiles, and the shown runtime static sampler filters use point mip selection. Please keep unrestricted implicit sampling out of this slice or add the matched mip-filter mapping and a two-mip startup draw that fails on an incorrect mip or blend.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 13:48 UTC · original · approved these changes

Re-reviewed d21e3d6e. The startup translator now limits the first slice to level zero and rejects unrestricted implicit mip selection. The three Release translation and sampler-binding checks passed. This verifies the translator and binding fixture scope.

**@⁠R0Y00** on GitHub · 2026-11-24 13:48 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1471#pullrequestreview-6040344032) · **approved these changes** Re-reviewed d21e3d6e. The startup translator now limits the first slice to level zero and rejects unrestricted implicit mip selection. The three Release translation and sampler-binding checks passed. This verifies the translator and binding fixture scope.
This discussion has been locked. Commenting is limited to contributors.
No description provided.