test_image_load_typed: model tagged descriptor hits #2160

Merged
leonida/mandy
whoalin1 merged 1 commit from image-load-typed-desc-model into main 2026-11-26 01:43:37 +00:00

Pull request successfully merged and closed

whoalin1 commented 2026-11-26 00:30:12 +00:00

Summary

tests/test_image_load_typed.py went red after #2098 because the tagged descriptor probe now returns (index, kind) as %desc_hit, while the test's small branch evaluator still modelled %desc_lookup_fn as returning the bare integer index. Extracting component 1 therefore indexed an int.

This updates only the test model: a tagged hit is a composite of the supplied index and a sampled-only kind word (sampled-dimension bits set, no storage-array bits); a miss remains index zero. No translator or runtime behavior changes.

Verification

Under the machine lock:

  • python -m compileall -q tests/test_image_load_typed.py tools/rdna2spirv.py — pass
  • unmodified origin/main copy of tests/test_image_load_typed.py — 28 run, 7 errors (TypeError: 'int' object is not subscriptable)
  • patched python -I tests/test_image_load_typed.py — 28 run, OK

No game data or GPU required.

AI-assisted (Devin).

## Summary `tests/test_image_load_typed.py` went red after #2098 because the tagged descriptor probe now returns `(index, kind)` as `%desc_hit`, while the test's small branch evaluator still modelled `%desc_lookup_fn` as returning the bare integer index. Extracting component 1 therefore indexed an int. This updates only the test model: a tagged hit is a composite of the supplied index and a sampled-only kind word (sampled-dimension bits set, no storage-array bits); a miss remains index zero. No translator or runtime behavior changes. ## Verification Under the machine lock: - `python -m compileall -q tests/test_image_load_typed.py tools/rdna2spirv.py` — pass - unmodified `origin/main` copy of `tests/test_image_load_typed.py` — **28 run, 7 errors** (`TypeError: 'int' object is not subscriptable`) - patched `python -I tests/test_image_load_typed.py` — **28 run, OK** No game data or GPU required. AI-assisted (Devin).
qhukz13 commented 2026-11-26 00:49:57 +00:00

Confirmed on Linux (Python 3.14.8): on current main 61732aca1, tests/test_image_load_typed.py fails with errors=7 (TypeError: 'int' object is not subscriptable, as described); with this head's copy of the file it passes (OK (skipped=2)).

The model matches the encoding: tools/rdna2spirv.py lays the kind word out as bit i = bound in dimension i's sampled array and bit 8 + i = in its storage arrays (DESC_SAMPLED_BIT / DESC_STORAGE_BIT, shared with runtime/src/descriptor_table.h), and %desc_hit is OpCompositeConstruct %desc_hit {index} {kind}. So (index, 0x3F) is "sampled in every dimension, in no storage array", and (0, 0) for a miss, which is what these tests want. Test-only, no translator change. Looks right; it turns a red file on main green.

AI-assisted (Claude Code).

Confirmed on Linux (Python 3.14.8): on current main `61732aca1`, `tests/test_image_load_typed.py` fails with `errors=7` (`TypeError: 'int' object is not subscriptable`, as described); with this head's copy of the file it passes (`OK (skipped=2)`). The model matches the encoding: `tools/rdna2spirv.py` lays the kind word out as bit `i` = bound in dimension `i`'s sampled array and bit `8 + i` = in its storage arrays (`DESC_SAMPLED_BIT` / `DESC_STORAGE_BIT`, shared with `runtime/src/descriptor_table.h`), and `%desc_hit` is `OpCompositeConstruct %desc_hit {index} {kind}`. So `(index, 0x3F)` is "sampled in every dimension, in no storage array", and `(0, 0)` for a miss, which is what these tests want. Test-only, no translator change. Looks right; it turns a red file on main green. AI-assisted (Claude Code).
aslan2142 commented 2026-11-26 01:43:39 +00:00

Merged, thanks! #2098 made the tagged descriptor probe return an (index, kind) pair, and this test's model now answers with one: a sampled-only hit, no storage-array bit.

  • Checked on main ad41fd517 + a64c4c163: the semantic suite passes (495 files, 6,333 tests, 0 files failed); test_image_load_typed pass; the 15 docs and writer tests pass; check_no_game_data.py is clean on the 1 changed files.

AI-assisted (Claude Code, Claude Opus 5.5).

Merged, thanks! #2098 made the tagged descriptor probe return an `(index, kind)` pair, and this test's model now answers with one: a sampled-only hit, no storage-array bit. - **Checked on `main` `ad41fd517` + `a64c4c163`:** the semantic suite passes (495 files, 6,333 tests, 0 files failed); `test_image_load_typed` pass; the 15 docs and writer tests pass; `check_no_game_data.py` is clean on the 1 changed files. AI-assisted (Claude Code, Claude Opus 5.5).
Sign in to join this conversation.
No description provided.