Skip to content

test(vk): guard report-word allocations and captured-copy offsets - #1136

Closed
pablitorockz wants to merge 2 commits into
NotRexed:mainfrom
pablitorockz:test/memory-copy-regressions
Closed

pablitorockz wants to merge 2 commits into
NotRexed:mainfrom
pablitorockz:test/memory-copy-regressions

Conversation

@pablitorockz

Copy link
Copy Markdown
Contributor

The existing memory fixtures can pass while a known-only report-word merge allocates scratch, or while mirror_sync supplies an incorrect source offset to the correctly tested copy helper. These cases protect the already-integrated memory optimizations against regressions.

  • Count real C++ heap allocations only around a repeated-known-word merge. Require zero allocations, the same sorted words and an empty pending list. Retain the existing 400-round set and byte-exclusion checks.
  • Compile the actual clipping and append expression from mirror_sync, then check hand-derived offsets and sizes for a pool with partial edge pages, interleaved capture buffers, gaps and a contiguous run. Retain the helper's existing byte-equivalence and overflow checks.

This tests-only branch also carries the identical answer-domain fixture correction proposed in #1009, so it can run independently against main at 8b2e1d3b895a5f890dcb886d904b62d6b38df2c7. That fixture declares the upstream answers_in input and checks supplied metadata, its variant hash and the empty-vector case.

Validation on Fedora 44 with Clang 23 and libstdc++ 16:

  • The original report-word fixture passes against the pre-vk: report words already kept are not merged in again #896 merge; the extended fixture fails with the expected allocation-count assertion. Both pass against current main.
  • The original capture fixture passes a four-byte source-offset mutation in the actual caller; the extended fixture compiles that same caller and rejects it with a literal offset assertion. The extended fixture passes with the unmodified caller.
  • Full game-free suite (python -I -B tests/run_all.py --jobs 2): 124 passed, 0 failed, 10 skipped. Five skips need spirv-val; the other five require the game, a Windows Vulkan device or Windows structured exceptions.
  • git diff --check passes. Only three test files are changed.

The existing source-regressions runner discovers these fixtures automatically. The new cases compile and execute production functions/expressions without a game dump or GPU. This change adds regression coverage; it does not report a new runtime-performance gain. Windows execution remains for CI.

pablitorockz and others added 2 commits November 9, 2026 07:43
record_answers now reads the thread-local answers_in during pipeline
preparation. The extracted fixture omitted that input and no longer compiled.

Declare it in the fixture and exercise supplied answer metadata, its literal
variant hash and the empty-vector case. Retain the existing canonical and
strict live-binding checks in every environment configuration.

Assisted-by: OpenAI Codex
Co-Authored-By: Codex <noreply@openai.com>
The report-word fixture checked set semantics but still passed when repeated
known words allocated scratch for a full merge. Count real allocations only
around that path and require the known words to remain unchanged.

The capture fixture exercised append_capture_copy directly, leaving the
clipping and offsets in mirror_sync untested. Compile the actual caller block
and check hand-derived source/destination ranges for clipped pages, separate
capture buffers, gaps and a contiguous run. Keep the existing helper cases.

Assisted-by: OpenAI Codex
Co-Authored-By: Codex <noreply@openai.com>
@pablitorockz
pablitorockz deleted the test/memory-copy-regressions branch November 9, 2026 13:55
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.

1 participant