test(nvn): a null texture builder is a scratch one #540

Merged
nicholasgower merged 1 commit from test/tex-builder-guard into main 2026-11-08 10:18:37 +00:00
nicholasgower commented 2026-11-08 09:27:08 +00:00 (Migrated from github.com)

What

Adds a game-free test for the null texture-builder path from issue #500. tb_or_scratch() in host/nvn_native.c (commit 0c511fd) returns a zeroed scratch builder when the game passes 0, so nvnTextureBuilderSetSwizzle no longer reads A64_MEM + 0x5c.

The fixture builds the real tb_or_scratch() and nvnTextureBuilderSetSwizzle() bodies from host/nvn_native.c at -O2, calls the setter with a null builder, requires exactly one diagnostic log, then checks that a real builder still receives swizzle 1/2/3/4.

Test

  • python -I -B tests/test_nvn_tex_builder_guard.py (wired into source-regressions.yml)
  • Pre-fix source (no tb_or_scratch) falls back to the old TB macro and dereferences NULL; the fixed source prints PASS.
  • No game files or GPU needed.

Refs #500.

## What Adds a game-free test for the null texture-builder path from issue #500. `tb_or_scratch()` in `host/nvn_native.c` (commit `0c511fd`) returns a zeroed scratch builder when the game passes 0, so `nvnTextureBuilderSetSwizzle` no longer reads `A64_MEM + 0x5c`. The fixture builds the real `tb_or_scratch()` and `nvnTextureBuilderSetSwizzle()` bodies from `host/nvn_native.c` at `-O2`, calls the setter with a null builder, requires exactly one diagnostic log, then checks that a real builder still receives swizzle 1/2/3/4. ## Test - `python -I -B tests/test_nvn_tex_builder_guard.py` (wired into `source-regressions.yml`) - Pre-fix source (no `tb_or_scratch`) falls back to the old `TB` macro and dereferences NULL; the fixed source prints PASS. - No game files or GPU needed. Refs #500.
nicholasgower commented 2026-11-08 09:32:05 +00:00 (Migrated from github.com)

The appimage job failed at its "Play profile" download step (the packaging workflow fetches the latest builder zip); it does not build or run the tests. The relevant checks pass: Python source checks on Ubuntu and Windows, including Check a null NVN texture builder is a scratch one, and the SPIR-V fixture job.

The `appimage` job failed at its "Play profile" download step (the packaging workflow fetches the latest builder zip); it does not build or run the tests. The relevant checks pass: `Python source checks` on Ubuntu and Windows, including `Check a null NVN texture builder is a scratch one`, and the SPIR-V fixture job.
Commenting is not possible because the repository is archived.
No description provided.