Skip to content

Stop test_mem_trim matching a bc_scratch_layout call that has moved on - #852

Closed
notquiteog wants to merge 1 commit into
NotRexed:mainfrom
notquiteog:fix/mem-trim-bc-guard
Closed

notquiteog wants to merge 1 commit into
NotRexed:mainfrom
notquiteog:fix/mem-trim-bc-guard

Conversation

@notquiteog

Copy link
Copy Markdown
Contributor

tests/test_mem_trim.py fails on main:

a BC3 upload uses a scratch it did not ask for

It is the test, not the renderer. The assertion counts an exact string:

need(tex.count("if (!bc_scratch_layout(cmd)) return false;") == 2, ...)

The uneven-BC-levels work gave that guard a second argument, so both call sites now read if (!bc_scratch_layout(cmd, tex.bc_resized)) return false; and if (!bc_scratch_layout(cmd, dst->bc_resized)) return false; (gpu/vk/vk_texture.cpp:700 and :2196). The property the check is about — every user asks for the scratch first and stops when it cannot be made — still holds at both sites; only the literal changed.

This matches the call with the argument list left open instead, so adding an argument does not break it again.

Checked that it is not now vacuous: with the guard at :2196 reduced to a bare bc_scratch_layout(cmd, dst->bc_resized); the check still fails, and it passes again when restored.

python -I -B tests/run_all.py goes from 14 failures to 13 here. The rest are a missing clang++ and pinned SPIR-V headers in my environment, not code.

AI assistance: recorded in the commit trailers.

…ved on

tests/test_mem_trim.py fails on main with "a BC3 upload uses a scratch it did
not ask for". It is the test, not the renderer: the assertion counts the exact
string "if (!bc_scratch_layout(cmd)) return false;", and the uneven BC levels
work gave that guard a second argument. Both call sites still check the return
(vk_texture.cpp:700 and :2196), so the property the check is about -- every
user asks for the scratch first and stops when it cannot be made -- holds; only
the literal changed.

Matches the call with the argument list left open, so adding an argument does
not break it again. Confirmed not vacuous: with the guard at :2196 reduced to a
bare call the check still fails, and passes again when restored.

Assisted-by: Claude Opus 5
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@NotRexed

NotRexed commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Thank you for the fix! #806 made the same repair to tests/test_mem_trim.py (checking both bc_scratch_layout call sites with their resize argument) and was merged a few minutes ago, so main's check passes again. Closing as a duplicate.

@NotRexed NotRexed closed this Nov 8, 2026
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.

3 participants