test_image_load_typed: model tagged descriptor hits #2160

Manually merged
github merged 1 commit from gh-pr/2160/head into gh-pr/2160/base 2026-11-26 10:20:43 +00:00
Owner

@⁠whoalin1 on GitHub · 2026-11-26 00:30 UTC · original
whoalin1:image-load-typed-desc-model → main · +5 −0 · 1 files · 1 commits · merged 2026-11-26 01:43 UTC

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).

**@⁠whoalin1** on GitHub · 2026-11-26 00:30 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2160) `whoalin1:image-load-typed-desc-model` → `main` · +5 −0 · 1 files · 1 commits · merged 2026-11-26 01:43 UTC ## 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).
#2098 made the tagged descriptor probe return (index, kind) as %desc_hit. The branch evaluator still modelled every %desc_lookup_fn call as the bare integer index, so extracting the kind component indexed an int and seven tests errored.\n\nModel a sampled-only hit as the composite the translator now emits: every sampled-dimension bit set, no storage-array bit. A miss remains index zero.\n\nVerification under the machine lock:\n- python -m compileall -q tests/test_image_load_typed.py tools/rdna2spirv.py\n- origin/main copy of tests/test_image_load_typed.py: 28 run, 7 errors (TypeError: 'int' object is not subscriptable)\n- patched tests/test_image_load_typed.py: 28 run, OK\n\nAI-assisted (Devin).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:20:41 +00:00
github manually merged commit a64c4c1635 into gh-pr/2160/base 2026-11-26 10:20:43 +00:00
Author
Owner

@⁠qhukz13 on GitHub · 2026-11-26 00:49 UTC · original

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).

**@⁠qhukz13** on GitHub · 2026-11-26 00:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2160#issuecomment-7179157679) 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).
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-26 01:43 UTC · original

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).

**@⁠aslan2142** on GitHub · 2026-11-26 01:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2160#issuecomment-7180063666) 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).
This discussion has been locked. Commenting is limited to contributors.
No description provided.