Skip to content

test: use valid synthetic Bink stream in collision fixture - #8329

Open
shoummobar wants to merge 1 commit into
ItsNotRexed:mainfrom
shoummobar:fix/test-streaming-and-line-endings
Open

shoummobar wants to merge 1 commit into
ItsNotRexed:mainfrom
shoummobar:fix/test-streaming-and-line-endings

Conversation

@shoummobar

@shoummobar shoummobar commented Nov 23, 2026 •

Copy link
Copy Markdown

Summary

  • Update make_bink() in tests/test_report_source_collision.py to create a valid synthetic KB2n Bink stream containing the sentinel payload. This lets bink_index accept the fixture and reach the source/output collision check.
  • The PR now contains only this unique fixture fix; overlapping changes were removed after review.

Verification

  • python -I tests/test_report_source_collision.py — 8/8 passed.
  • Independently checked on Windows and Arch Linux; no game files used.

AI-assisted contribution.

@shoummobar shoummobar changed the title fix(tests): pass missing globals to streaming test VM & pin newline in file writers fix(tests, docs, tools): fix test globals, encoding guards, link anchors and docs flags Nov 23, 2026
@shoummobar shoummobar changed the title fix(tests, docs, tools): fix test globals, encoding guards, link anchors and docs flags fix(tests, docs, tools): fix test globals, encoding guards, docs links, and bink collision fixture Nov 23, 2026
@KoertLichtendonk

Copy link
Copy Markdown
Contributor

Coordinator note: this looks like the same change as #8094 by @fnnendksndkdneen (opened 18:05 UTC, still open). Please compare the two and either close this one or say here what it adds. The maintainer decides which one is merged.

@RAINighty

Copy link
Copy Markdown

Tested d7ee1b04c merged with main 867d922f0 (clean merge) on Windows 11 (10.0.26300), Python 3.13.15 in UTF-8 mode (PYTHONUTF8=1; venv with the pinned tests/requirements.txt): pass, and it turns two red tests on main green.

  • python -I tests/test_docs_cli_flags.py: main FAILED (failures=1), with this PR OK (Ran 4 tests).
  • python -I tests/test_report_source_collision.py: main FAILED (failures=1), with this PR OK (Ran 8 tests).
  • Control: with main's versions of this PR's non-test files (the docs, scripts/dev.py and the tools/*.py it touches) under the PR's test files, both tests are still OK, so on this machine the fix for those two comes from the test-file changes. I did not check what the tool and doc changes do.
  • Code not reviewed beyond running it. No GPU or game files.

AI-assisted (Claude Code).

@Cryserrrrr

Copy link
Copy Markdown

Tested d7ee1b04c merged onto main 867d922f0 (clean) on Windows 11 (fr-FR, cp1252, default console, no PYTHONUTF8), Python 3.14.7, Node 24.19: partial pass, one failure left on current main.

  • These go from FAIL to OK:
    • test_text_write_line_endings (3 tests)
    • test_docs_links (7)
    • test_docs_cli_flags (4)
    • test_report_source_collision (8)
    • node --test tests/test_viewer_streaming.cjs: the AbortController ReferenceError is gone, 57/57 pass.
  • Still failing: tests/test_tool_stdout_encoding.py (1 of 4) lists tools/semantic_mutants.py. That tool came with tools/semantic_mutants.py: op-scoped mutation testing for tests/seman… #6548 after this PR's base and has no sys.stdout.reconfigure(errors="replace") guard yet. Adding the same guard there (or a rebase) should make this green.
  • The earlier pass on this head ran in UTF-8 mode, where this test can't see the problem.

AI-assisted (Claude Code).

@OlaiFG7

OlaiFG7 commented Nov 23, 2026

Copy link
Copy Markdown

Reviewed d7ee1b0, code read (CPU), AI-assisted: every change here is correct. Reverting the source part in a throwaway worktree turns the touched tests red: test_docs_links, test_text_write_line_endings and test_tool_stdout_encoding fail, and node --test tests/test_viewer_streaming.cjs drops to 56/57 on AbortController is not defined. With the PR's test-file changes reverted, test_docs_cli_flags and test_report_source_collision also fail. At the PR head they all pass (docs_links 7, docs_cli_flags 4, report_source_collision 8, text_write_line_endings 3, tool_stdout_encoding 4, node 57).

The problem is scope: nearly every piece already exists in an open PR.

Only the make_bink() fixture change in test_report_source_collision.py has no counterpart that I found. Also, the branch is not rebased: test_tool_stdout_encoding passes at this head only because the merge-base lacks semantic_mutants.py, which #8629 covers, so that test is red on current main (as Cryserrrrr reported; I did not run the PR merged onto main myself).

Suggestion: close this one, or reduce it to the make_bink() fixture and rebase onto main. AGENTS.md rules hold: no game data, the new writes pin their newline, and the gpu_test_results.md edit is a link change only.

@karearl

karearl commented Nov 23, 2026

Copy link
Copy Markdown

On main here d3d12_vulkan_device (tiles == 1, fixed by #8496/#7125) and d3d12_depth_resolve fail without the PR too; one-off failures in a full -j 8 run were rerun alone 3 times and passed.

AI-assisted (Claude Code).

@ddaikodaiko

Copy link
Copy Markdown

Independent Windows check of d7ee1b0, run side by side with main 867d922f0 on the same machine (two checkouts). This is the "Win" item in the review queue, and all six files the PR touches reproduce a failure on main here, so the before/after is direct.

Environment: Windows 10 Pro 10.0.19045, Ryzen 5 1600, RTX 3060 Ti, Python 3.14.3 (C:\Python314), Node 24.14.1, Git Bash's git on PATH. Fresh git clone --depth 1, then git fetch origin pull/8329/head. No game files. Commands: python -I tests\<name>.py and node --test tests\test_viewer_streaming.cjs from the checkout root.

Test main 867d922f0 d7ee1b0
test_docs_links FAILED (failures=1), 7 tests: docs\dev-tools.md anchor #a-600-frame-headless-guest-scene not found, docs\gpu_test_results.md → gpu-test-results/RX9070GRE.txt missing file OK, 7/7
test_docs_cli_flags FAILED (failures=1), 4 tests: the seven spirv-opt flags in docs/embedded_shaders.md:372-377 (--ssa-rewrite, --eliminate-dead-code-aggressive, --cfg-cleanup, --eliminate-dead-branches, --merge-blocks, --merge-return, --scalar-replacement) OK, 4/4
test_text_write_line_endings FAILED (failures=1), 3 tests: tools\leonida_tui.py:753, tools\wave_diff.py:373 OK, 3/3
test_tool_stdout_encoding FAILED (failures=1), 4 tests: 12 programs, starting tools/awc_cue_labels.py, tools/bvh_slot_check.py, ending scripts/dev.py OK, 4/4
test_report_source_collision FAILED (failures=1), 8 tests: bink_index: error: ...\x.bk2: not a Bink 2 stream (KB2) or an RPF archive OK, 8/8
node --test tests/test_viewer_streaming.cjs 57 tests, 56 pass, not ok 16 - Shift speeds the camera up and Ctrl slows it down, on either side of the keyboard 57/57

Two notes:

Nothing else in the tree changed between the two runs (same shallow clone, same Python and Node).

@shoummobar
shoummobar force-pushed the fix/test-streaming-and-line-endings branch from d7ee1b0 to 754af20 Compare November 23, 2026 20:41
@morodirule

Copy link
Copy Markdown

Tested 754af20 (new head; prior checks were on superseded d7ee1b0, which touched 14 files — this head touches only tests/test_report_source_collision.py) on Arch Linux, Python 3.14.10, CPU only: pass. 8/8 OK. Negative control: merge-base test file fails 1; restored, 8/8 green. No game files. AI-assisted.

@shoummobar shoummobar changed the title fix(tests, docs, tools): fix test globals, encoding guards, docs links, and bink collision fixture test: use valid synthetic Bink stream in collision fixture Nov 23, 2026
@voidsshadows

Copy link
Copy Markdown

Independent Windows verification — PASS

Tested PR #8329 at commit 754af20e476a9ea7b29e35a077d6533d83bb18e7.

Environment: Windows, Python 3.11.9.

Results:

  • python -I tests/test_report_source_collision.py — 8/8 PASS (0.778s)
  • git --no-pager diff --check origin/main...HEAD — PASS

No game files used. Synthetic fixtures only.

Independent Windows test verification of the updated PR head. No comprehensive code review performed.

AI-assisted reporting.

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.

9 participants