Skip to content

tests: guard renderer frame wrapping#258

Draft
cursor[bot] wants to merge 1 commit into
next-gen-5from
cursor/missing-test-coverage-56a5
Draft

tests: guard renderer frame wrapping#258
cursor[bot] wants to merge 1 commit into
next-gen-5from
cursor/missing-test-coverage-56a5

Conversation

@cursor

@cursor cursor Bot commented Jun 13, 2026

Copy link
Copy Markdown

Summary

  • Add a deterministic renderer source guard for MD3, MDR, and IQM frame wrapping paths.
  • Register test_renderer_frame_wrap_guards with CTest and document it in tests/README.md.

Risky behavior now covered

  • Frame wrapping must verify positive frame counts before modulo to prevent divide-by-zero regressions.
  • Invalid current/old animation frames must reset before frame-indexed culling/draw work.
  • IQM backend surface animation must fall back to frame 0 when num_frames is zero.
  • Mirrored OpenGL/Vulkan renderer files under both src/renderers and src/platform/renderers stay in sync.

Test files added/updated

  • Added tests/scripts/test_renderer_frame_wrap_guards.py
  • Updated CMakeLists.txt
  • Updated tests/README.md

Why this reduces regression risk

Recent renderer fixes touched edge-case animation frame wrapping in duplicated renderer code. These checks are fast, deterministic, do not require GPU/game data, and pin the ordering that prevents modulo-by-zero and out-of-bounds frame access regressions.

Validation

  • python3 tests/scripts/test_renderer_frame_wrap_guards.py /workspace
  • cmake -S . -B build-coverage-tests -DBUILD_TESTING=ON -DBUILD_UNIT_TESTS=OFF && ctest --test-dir build-coverage-tests -R test_renderer_frame_wrap_guards --output-on-failure
Open in Web View Automation 

Co-authored-by: Tim Fox <timfox@outlook.com>
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