Skip to content

startup: lower 1D image sampling with an explicit level - #1722

Merged
R0Y00 merged 4 commits into
R0Y00:mainfrom
triggered02:startup/img-1d
Nov 26, 2026
Merged

R0Y00 merged 4 commits into
R0Y00:mainfrom
triggered02:startup/img-1d

Conversation

@triggered02

Copy link
Copy Markdown
Contributor

Fixes #1721. Fifth group from the loading-screen refusal census (#870): 2 of 29 shaders.

Change

A 1D image has one coordinate, and image_sample_lz / image_sample_l carry the explicit level in the next address dword. Only the implicit-level image_sample was accepted for 1D, so the explicit-level forms were refused:

image_sample_lz v[4:7], v0, s[8:15], s[12:15] dmask:0xf dim:SQ_RSRC_IMG_1D
  before -> REFUSED: unverified 1D image sample address or modifiers
  after  -> t = r0.SampleLevel(smp0, F(v0), 0);

image_sample_l v[4:6], v[0:1], s[8:15], s[12:15] dmask:0x7 dim:SQ_RSRC_IMG_1D
  after  -> t = r0.SampleLevel(smp0, F(v0), F(v1));

Texture1D.SampleLevel takes exactly one float location, which is what the one branch already built, so this needed the guard to admit the forms rather than a new lowering.

Boundaries kept, each refused by name: a 1D image_load (different address packing), a 1D sample_lz with more address dwords than the form takes, and modifiers that change the address or result layout (unorm, r128, a16, d16, …). The implicit-level 1D form and every 2D form emit byte-identical text to before.

Test

startup_gfx2hlsl_image_1d builds MIMG encodings from the checked-in decoder's layout (0b111100 prefix, opcode [24:18]/bit 0, dmask [11:8], dimension [5:3], NSA count [2:1]), decodes them, then translates — no game-derived bytes.

dev:     startup_gfx2hlsl_image_1d Passed 0.14 s; all 7 startup_gfx2hlsl tests pass
release: startup_gfx2hlsl_image_1d Passed 0.14 s

Fail-first: restoring the old 1D guard fails the test with Unsupported: unverified 1D image sample address or modifiers.

Census A/B (local, aggregates only)

Refusals grouped as SQ_RSRC_IMG_1D go 1 → 0 (the current cache holds one; the stored census had two), and that shader progresses to v_readfirstlane_b32 requires a proven uniform source.

What this does not establish

  • That the loading screen gets further — needs a run that visibly reaches it; counts are local aggregates.
  • 1D image_load address packing, 1D array forms and 1D gathers stay refused.

AI-assisted (Claude Code).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
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-24T17:51:25.351754Z 11a5a01 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 11a5a01975

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

Comment thread tools/startup/gfx2hlsl.py Resolved

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of PR #1722 (11a5a0197513b92709d9ab3ffa38374850941cc7).

Findings

  • P1 — Existing regression test startup_image_sample_l fails (tests/startup_image_sample_l_check.py:228):
    tests/startup_image_sample_l_check.py defines 'dim1d': 'image_sample_l v[4:7], v[0:1], s[16:23], s[24:27] dmask:0xf dim:SQ_RSRC_IMG_1D' (line 60) and asserts refused('dim1d', 'unverified 1D image sample address or modifiers') at line 228. Because tools/startup/gfx2hlsl.py now lowers 1D image_sample_l with 2 address registers (u, lod), stage('dim1d') is accepted and startup_image_sample_l fails on both Linux and Win2025 Debug:
    File "tests/startup_image_sample_l_check.py", line 228, in controls
      refused('dim1d', 'unverified 1D image sample address or modifiers')
    File "tests/startup_image_sample_l_check.py", line 186, in refused
      raise AssertionError('%s was accepted' % name)
    AssertionError: dim1d was accepted
    
    Update tests/startup_image_sample_l_check.py to expect 1D image_sample_l to lower to Texture1D / SampleLevel(..., F(v0), F(v1)) instead of refusing dim1d.

What looks good

  • In tools/startup/gfx2hlsl.py, 1D image_sample_lz (1 address dword, level 0) and 1D image_sample_l (2 address dwords [u, lod]) lower to Texture1D<float4>.SampleLevel(...), while image_sample (1D implicit level), image_load, extra address dwords, and modifiers such as unorm remain refused.
  • llvm-mc-19 -triple=amdgcn-- -mcpu=gfx1030 -show-encoding encodings for image_sample_lz (dmask:0xf, with/without glc, unorm) and image_sample_l (dmask:0x7) on SQ_RSRC_IMG_1D decode and lower/refuse as expected in gfx2hlsl.py.

Local checks & Win2025 verification

  • python3 /root/.local/state/xbox2windows/pipeline/x2w_pipe.py prep-verify 1722 --dir /tmp/rev-x2w-82/1722 --json: git_diff_check, docs_links_check, bidi_controls_check, py_compile all passed.
  • python3 -B tests/startup_gfx2hlsl_image_1d_check.py: PASS (10/10 checks).
  • python3 -B tests/startup_image_sample_l_check.py: FAIL (AssertionError: dim1d was accepted, exit code 1).
  • Local mutation check: changing 'l': 2 to 'l': 3 in tools/startup/gfx2hlsl.py caused tests/startup_gfx2hlsl_image_1d_check.py to fail with gfx2hlsl.Unsupported: unverified 1D image l address or modifiers (exit code 1); restored via git checkout -- ., after which startup_gfx2hlsl_image_1d_check.py passed again.
  • Win2025 (x2w_pipe.py win2025 1722 with focused startup targets and --regex '^(startup_gfx2hlsl_image_1d|startup_image_sample_l|startup_image_sample_c|startup_gfx2hlsl_capture|startup_gfx2hlsl_sdwa|startup_gfx2hlsl_smem_offset|startup_gfx2hlsl_bit_alu_controls|startup_gfx2hlsl_bit_alu_warp|startup_translator|startup_stubs)$'):
    • Debug (dev): 9/10 passed (startup_gfx2hlsl_image_1d passed); 1 failed (322 - startup_image_sample_l), exit code 1.
    • Release (/O2): not reached because the Debug ctest phase failed.

AI-assisted; commands listed were executed locally.

triggered02 added a commit to triggered02/Xbox2Windows that referenced this pull request Nov 24, 2026
Review on R0Y00#1722 (P1, found by both Codex and tedin7): tests/startup_image_sample_l_check.py still asserted that a 1D image_sample_l is refused, which the lowering now accepts. The case now checks the Texture1D declaration and the SampleLevel(smp, F(v0), F(v1)) call shape instead, and the controls print no longer lists 1D as refused. Full startup_image*/startup_gfx2hlsl* family passes in dev (18/18) and the two affected tests pass in release.
@triggered02

Copy link
Copy Markdown
Contributor Author

Fixed in fcdb6187.

tests/startup_image_sample_l_check.py still asserted the 1D refusal. That case now checks the lowering instead:

one_d = stage('dim1d')
assert 'Texture1D<float4>' in one_d
assert re.search(r'SampleLevel\(\w+, F\(v0\), F\(v1\)\)', one_d)

and the controls print no longer lists 1D among the refused forms.

Verified with the whole family this time, not just the new test:

dev:     startup_image* + startup_gfx2hlsl*  18/18 passed
release: startup_image_sample_l, startup_gfx2hlsl_image_1d  both passed

You are right that this was catchable from the diff — the existing test names the very case I changed, and my ctest regex only matched ^startup_gfx2hlsl. The rule I took from it: for a change in gfx2hlsl.py, run every ctest family that reaches it, not the new test's prefix.

AI-assisted (Claude Code).

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review of PR #1722 (fcdb6187baba8d6be4dce3145ae4a9db09ab8c34).

Findings

No blocking issues found; the previous P1 on tests/startup_image_sample_l_check.py:228 is resolved.

What looks good

  • tests/startup_image_sample_l_check.py:192-196 now verifies that dim1d lowers to Texture1D<float4> with SampleLevel(..., F(v0), F(v1)) instead of expecting a refusal.
  • tools/startup/gfx2hlsl.py:708-731 handles 1D image_sample (1 addr dword), image_sample_lz (1 addr dword, level 0), and image_sample_l (2 addr dwords [x, lod]), allowing dlc/glc/slc only on lz/l and keeping image_load, extra address dwords, empty dmask, and layout-changing modifiers (unorm, r128, a16, d16, etc.) refused.
  • Clean llvm-mc-19 -triple=amdgcn-- -mcpu=gfx1030 -show-encoding roundtrip through gfx2hlsl.decode for 1D image_sample_lz and image_sample_l.

Checks & verification

  • python3 /root/.local/state/xbox2windows/pipeline/x2w_pipe.py prep-verify 1722 --dir /tmp/rev-x2w-83/1722 --json: git_diff_check, docs_links_check, bidi_controls_check, py_compile (3 files) all passed.
  • Linux:
    • python3 -B tests/startup_gfx2hlsl_image_1d_check.py: PASS (10/10 checks).
    • python3 -B tests/startup_image_sample_l_check.py: passed.
    • python3 -B tests/startup_image_sample_c_check.py: passed.
    • llvm-mc-19 -triple=amdgcn-- -mcpu=gfx1030 -show-encoding + gfx2hlsl.decode: 1D image_sample_lz (0x00,0x0f,0x9c,0xf0,0x00,0x04,0x62,0x00) and image_sample_l (0x00,0x07,0x90,0xf0,0x00,0x04,0x62,0x00) decoded as expected.
  • Local mutations on tools/startup/gfx2hlsl.py (restored via git checkout -- tools/startup/gfx2hlsl.py after each):
    • 'l': 2 -> 'l': 3: both tests/startup_gfx2hlsl_image_1d_check.py and tests/startup_image_sample_l_check.py failed with gfx2hlsl.Unsupported: unverified 1D image l address or modifiers (exit code 1).
    • Allowing 'unorm' in the 1D modifier allowlist: tests/startup_gfx2hlsl_image_1d_check.py failed on a unorm 1D sample_lz stays refused: MISMATCH (exit code 1).
  • Win2025 (x2w_pipe.py win2025 1722 --targets cpu_shim_startup,cpu_shim_startup_guest,cpu_shim_startup_lifted,d3d12_xs_shim --regex '^(startup_gfx2hlsl_image_1d|startup_image_sample_l|startup_image_sample_c|startup_gfx2hlsl_capture|startup_gfx2hlsl_sdwa|startup_gfx2hlsl_smem_offset|startup_gfx2hlsl_bit_alu_controls|startup_gfx2hlsl_bit_alu_warp|startup_image_2d_array_controls|startup_image_2d_array_warp|startup_image_3d_controls|startup_image_3d_warp|startup_translator|startup_stubs)$'):
    • Debug (--preset dev): build 5.26s, 14/14 passed (5.29s).
    • Release /O2 (--preset release): build 3.24s, 14/14 passed (5.20s).

AI-assisted; commands listed were executed locally.

@tedin7 tedin7 left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of head 08e9a8ab6c81ee672bf82d9fe653d50c1def4b27 (a merge of main into the branch on top of 11a5a019 and fcdb6187). My earlier re-review was on fcdb6187; 08e9a8ab only merges main, so the diff against main is the same two commits.

Verdict: no blocking finding. The lowering is right as far as I can check without a shader compiler. There are three untested boundaries (P2 below); each is a one-line test.

Linux limits. Linux x86_64 only. No CMake configure and no ctest, no Windows, no GPU, and no DXC or FXC on this machine, so the emitted Texture1D.SampleLevel text is compared as text and never compiled. I could not run the pipeline's Windows helper from here. The PR has no draw test; it is translator-only, which fits the change, but nothing in it proves the HLSL compiles.

Reading of the change (tools/startup/gfx2hlsl.py:737-745, :757)

  • 1D now accepts sample (1 address dword), lz (1) and l (2, x then level); any other form, a wrong dword count or an empty dmask is refused by name. 1D image_load and image_load_mip stay refused (expected is None).
  • Modifiers: dim:/dmask: always; dlc/glc/slc only on lz/l; everything else (unorm, r128, a16, d16, tfe, lwe, reserved bits) is refused. The plain 1D sample keeps the old rule, so it still refuses cache bits as before.
  • l: expected = 4 if three else (2 if one else 3), then lod = cs[-1], so uv is F(v0) and the level F(v1); lz samples at level 0. SampleLevel(sampler, float, float) is the right Texture1D overload, and tex1d binding already exists on main (#1630).
  • The test's encoder matches the assembler: llvm-mc-19 -triple=amdgcn -mcpu=gfx1030 -show-encoding gives [0x00,0x0f,0x9c,0xf0,0x00,0x04,0x62,0x00] for the 1D image_sample_lz, [0x00,0x07,0x90,0xf0,...] for image_sample_l and [0x00,0x03,0x80,0xf0,...] for image_sample, equal to what encode_mimg builds (opcode 0x27/0x24/0x20, same vaddr/vdata/srsrc/ssamp words).

What I ran on this head (worktree at the exact SHA; clean after every mutation)

  • startup_gfx2hlsl_image_1d_check.py, startup_image_sample_l_check.py and the other seven startup_gfx2hlsl_*_check.py scripts: all exit 0. git diff --check origin/main...HEAD clean; docs_links_check.py 17 files / 366 links; bidi_controls_check.py clean.
  • Mutations of gfx2hlsl.py, each restored:
Mutation image_1d check image_sample_l check
'l': 2 -> 'l': 3 fails fails
level taken from cs[0] instead of cs[-1] fails fails
1D modifier loop removed fails (unorm case) passes
cache bits also allowed on the plain 1D sample passes passes
1D empty dmask accepted (or not dmask dropped) passes passes
dlc/glc/slc refused on 1D lz/l passes passes

Findings

  1. P2, test gap: the three surviving mutations above. The PR text says the implicit 1D form is unchanged, and the new guard decides cache bits and dmask; none of that is pinned. Suggested cases in tests/startup_gfx2hlsl_image_1d_check.py: a 1D image_sample with glc stays refused; a 1D image_sample_lz with dmask:0 is refused; a 1D image_sample_lz and image_sample_l with glc/dlc/slc lower to the same text as without. (encode_mimg has no cache-bit parameter yet; the bytes can be taken from llvm-mc-19 -triple=amdgcn -mcpu=gfx1030 -show-encoding for the same instruction with glc, slc or dlc added.)
  2. P3: the refusal message changed from unverified 1D image sample address or modifiers to unverified 1D image <how> address or modifiers and adds 1D image <how> modifier <m>. Nothing in the repo greps the old text (grep -rn "unverified 1D" tests tools docs finds only the new line), but tools/startup/triage_run.py groups unknown shader reasons under "other", so a census that used the old string will move. Fine, just worth knowing for the A/B in #870.
  3. P3, wording: docs and test docstring say "first main-game loading-screen cache"; AGENTS.md asks for title-neutral text.
  4. Not verified by me: the census counts (local cache), and that the emitted Texture1D text compiles with DXC and FXC. A one-off compile of the two emitted lines on Windows would settle that.

AI-assisted; commands listed were executed locally.

@triggered02

Copy link
Copy Markdown
Contributor Author

Thanks — and you were right about the P1 on the earlier head; that was my test inheriting a stale expectation and it is fixed.

Status on this head (bb12bd75): I merged current main (82749f0f, after #1699 landed) into the branch; the CMakeLists.txt and docs/experiments.md conflicts were resolved keeping both sides. The PR is mergeable again.

P3 wording: fixed in the paragraph this branch adds and in the test docstring — it now says "in the first loading-screen cache" rather than "first main-game loading-screen cache". The remaining main-game occurrences in docs/experiments.md are in the older #1705/#1709 paragraphs, not part of this PR, so I left them alone rather than widen the diff.

P3 refusal message: noted — the message is now named per form (unverified 1D image <how> address or modifiers, plus 1D image <how> modifier <m>), so anything that grouped the old single string will move. That is intended (a census consumer should see which form and which modifier), but I agree it is worth knowing for the #870 A/B.

P2 — accepted, and it is the same finding you raised on #1793 and #1798: my tests compare text, not values. The three mutations that survived are real gaps:

mutation why it survives
cache bits allowed on the plain 1D sample no case encodes a 1D sample with glc
empty dmask accepted no case encodes dmask:0
dlc/glc/slc refused on 1D lz/l no case encodes a cache-bit form of those

I am adding exactly those three cases to startup_gfx2hlsl_image_1d_check.py in the next commit (encoder gains the cache-bit fields), so the branch pins the guard rather than the text. I will reply here when it is pushed.

For #1798 and #1793 I have already replaced the text checks with a value-level pattern: a Python reference plus a small evaluator that runs the emitted helper body over a grid (68,626 binary32 patterns for class32, and the same approach for mul_hi_u32 against (a*b) >> 32). That is the right shape for these, and it is what caught the mutation you demonstrated.

AI-assisted (Claude Code).

@triggered02

Copy link
Copy Markdown
Contributor Author

All three P2 gaps are now pinned in HEAD (startup_gfx2hlsl_image_1d_check.py), and each of your mutations fails.

The encoder gained the MIMG cache fields, taken from the MIMG modifier decoding in tools/disasm_rdna2.py (glc = w0[13], slc = w0[25], dlc = w0[7]) — deliberately not the MUBUF positions from the shared buffer decoder, which are different bits.

New cases:

a glc 1D sample stays refused
a 1D sample_lz with an empty dmask is refused
a glc 1D sample_lz lowers like the plain one      a glc 1D sample_l lowers like the plain one
a slc 1D sample_lz lowers like the plain one      a slc 1D sample_l lowers like the plain one
a dlc 1D sample_lz lowers like the plain one      a dlc 1D sample_l lowers like the plain one

The lowers like the plain one cases compare the full emitted text for equality, so a cache bit that changed the lowering would fail, and a cache bit that raised would fail too.

Fail-first, your three mutations:

cache bits allowed on the plain 1D sample   -> "a glc 1D sample stays refused" FAIL
empty dmask accepted                        -> "a 1D sample_lz with an empty dmask is refused" FAIL
cache bits refused on the 1D lz/l forms     -> Unsupported: 1D image lz modifier glc

Debug startup_gfx2hlsl_image_1d, startup_image_sample_l and startup_translator 3/3, release startup_gfx2hlsl_image_1d Passed.

On your remaining points: the emitted Texture1D.SampleLevel text still has not been through DXC or FXC here (no shader compiler on this machine either), so that limitation stands and your "translator-only, nothing proves it compiles" reading is accurate. The census counts also remain unverified from my side.

AI-assisted (Claude Code).

triggered02 added a commit to triggered02/Xbox2Windows that referenced this pull request Nov 24, 2026
Review on R0Y00#1722 (P2): three mutations survived the test because no case encoded them - cache bits allowed on the plain 1D sample, an empty dmask accepted, and cache bits refused on the lz/l forms. The encoder now carries the MIMG cache fields (glc w0[13], slc w0[25], dlc w0[7], from the MIMG modifier decoding, not the MUBUF positions). New cases: a glc 1D sample stays refused, a 1D sample_lz with dmask:0 is refused, and glc/slc/dlc on the 1D lz and l forms lower to the same text as without them. Fail-first: each of the three mutations now fails its case.

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review of PR #1722 at a7776750517c92d548f6ea0dbe608a88c9948c2f. The branch moved past bb12bd75 while I was checking: bb12bd75 is its parent, and the new tip adds one commit on top of it. My previous review was at 08e9a8ab.

Verdict: no P1, no P2. The earlier P2 is closed.

What changed since my review (5acd3364 merges main, then bb12bd75 and a7776750)

  • bb12bd75 (wording): the paragraph in docs/experiments.md and the docstring in tests/startup_gfx2hlsl_image_1d_check.py now say "the first loading-screen cache". P3 wording: closed.
  • a7776750 (tests only): encode_mimg gets glc, slc and dlc (word 0 bits 13, 25 and 7, which are the MIMG positions in the encoding I checked earlier), and section 7 adds a glc 1D image_sample that stays refused, a 1D image_sample_lz with dmask:0 that is refused, and glc/slc/dlc on 1D lz and l that lower to the same text as the plain form. tools/startup/gfx2hlsl.py is unchanged by it. P2 test gap: closed, see the mutations.
  • Still open, as before: P3 the refusal text changed (unverified 1D image <how> address or modifiers), nothing in the repo greps the old text; and the emitted Texture1D.SampleLevel text is not compiled by me.

Commands run locally on Linux (worktree at the exact SHA)

  • python3 -B tests/startup_gfx2hlsl_image_1d_check.py: passes, 18 lines "ok" then PASS.
  • python3 -B tests/startup_image_sample_l_check.py and tests/startup_image_sample_c_check.py: pass. All 13 tests/startup_gfx2hlsl_*_check.py scripts exit 0.
  • python3 -B tests/docs_links_check.py (18 files, 370 links), python3 -B tests/bidi_controls_check.py (1323 files): pass. git diff --check origin/main...HEAD: clean.

Local mutations of gfx2hlsl.py against startup_gfx2hlsl_image_1d_check.py (each restored with git checkout -- ., tree clean afterwards)

Mutation Result
cache bits also allowed on the plain 1D sample fails (was surviving)
1D empty dmask accepted fails (was surviving)
dlc/glc/slc refused on 1D lz/l fails (was surviving)
level taken from cs[0] instead of cs[-1] fails
'l': 2 -> 'l': 3 fails

All three mutations that survived before now fail.

Not run: a Windows build and CTest, and DXC/FXC on the emitted Texture1D lines.

AI-assisted; commands listed were executed locally.

@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

@triggered02 could you rebase this branch onto current main and force-push?

GitHub reports head a7776750 as conflicting with main, so it cannot be merged as is.

Files that conflict with current main (cf97bee1):

  • docs/experiments.md
  • tools/startup/gfx2hlsl.py

Commands run locally:

git fetch origin main pull/1722/head
git merge-tree --write-tree --name-only origin/main FETCH_HEAD
gh pr view 1722 --json mergeable   # CONFLICTING

Once it is rebased and CI is green it will be re-checked right away.

AI-assisted; commands listed were executed locally.

@triggered02

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and force-pushed.

  • #1821 (src_scc): merged main in, resolved the CMakeLists.txt registration conflict keeping both sides, head is 5dc597c1. startup_gfx2hlsl_src_scc and startup_translator pass.
  • #1778 (modifier-free): head 7a72fab0. Merging main surfaced a real behaviour change — v_interp_mov_f32 now decodes the parameter selector as p10, p20, p0 and refuses p10/p20 because they need per-vertex attribute values. My test used the old p0 encoding, which now decodes as p10, so it failed. Fixed the fixture (src1 = 2 for p0) and added checks that p10 and p20 are refused rather than read as p0. startup_gfx2hlsl_modifier_free and startup_translator pass.
  • #1722 (1D sampling): head b96eb6b7; the only conflict was an older docs/experiments.md paragraph you had since rewritten, so I kept main's version of it and dropped my wording-only change there. startup_gfx2hlsl_image_1d, startup_image_sample_l and startup_translator pass.

Two of the five I closed rather than rebased, because their content is already on main or duplicated:

AI-assisted (Claude Code).

@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

@triggered02 could you rebase this branch onto current main and force-push?

GitHub reports head b96eb6b7 as conflicting with main, so it cannot be merged as is.

Files that conflict with current main (214ed093):

  • docs/experiments.md
  • tools/startup/gfx2hlsl.py

Commands run locally:

git fetch origin main pull/1722/head
git merge-tree --write-tree --name-only origin/main FETCH_HEAD
gh pr view 1722 --json mergeable   # CONFLICTING

Once it is rebased and CI is green it will be re-checked right away.

AI-assisted; commands listed were executed locally.

@triggered02

Copy link
Copy Markdown
Contributor Author

Re-created cleanly onto origin/main (7092683a) as a single commit (f2be229c) to clear the merge conflict, and synced two tests with current main:

  • tests/startup_gfx2hlsl_image_1d_check.py: updated its test stub to match current main sampler validation (lod_unvalidated = set(), lod_limits=False on sampler(), zeroed constant sampler words ('const', 0)).
  • tests/startup_image_sample_b_check.py: updated the dim1d refusal string from 'unverified 1D image sample address or modifiers' to 'unverified 1D image b address or modifiers' to match unverified 1D image %s address or modifiers in Stage.image.
  • tests/startup_image_sample_l_check.py, CMakeLists.txt, and docs/experiments.md (own clean ## section) remain intact.

Measured checks

  • tests/startup_gfx2hlsl_image_1d_check.py (18/18 ok), startup_image_sample_l_check.py, startup_image_sample_b_check.py, startup_image_sample_c_check.py, startup_translator_check.py, plus 11 additional startup image/translator checks (tools/run_checks_parallel.py): 18/18 passed.
  • tests/docs_links_check.py (466 links), tests/bidi_controls_check.py, git diff --check origin/main: clean.
  • Fail-first mutations ('l': 2 → 'l': 3, allowing glc on plain 1D sample, and dropping or not dmask): all 3 fail startup_gfx2hlsl_image_1d_check.py (exit 1).

Not established

  • Translator-only checks here; no DXC/FXC compilation or GPU draw of the emitted Texture1D.SampleLevel HLSL.

AI-assisted (Gemini).

legacy-code-archaeologist added a commit to legacy-code-archaeologist/Xbox2Windows that referenced this pull request Nov 25, 2026
# Conflicts:
#	CMakeLists.txt
#	docs/experiments.md
#	tests/startup_image_sample_l_check.py
legacy-code-archaeologist added a commit to legacy-code-archaeologist/Xbox2Windows that referenced this pull request Nov 25, 2026
…#1722

R0Y00#1722 names the sample kind in the 1D refusal; main's startup_image_sample_d_check
still expects the 'sample' wording for image_sample_d on a 1D image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@R0Y00 R0Y00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed the exact LOD draw and integrated main. Release CTest passed 7/7 with the 1D controls, adjacent 3D tests and both draw backends. WARP and RTX 4060 Laptop read mip zero for sample_lz at inputs one and two, and correctly selected mip one and mip two for sample_l. The fixed-zero shader read mip zero where mip two was expected on both backends. No capability skips or debug-layer messages in those draws. The new CTests are startup_gfx2hlsl_image_1d_warp and startup_gfx2hlsl_image_1d_hardware.

@R0Y00
R0Y00 merged commit f4b53e0 into R0Y00:main Nov 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

startup: 1D image sampling refuses the explicit-level forms (2 of 29 loading-screen shader refusals)

3 participants