Skip to content

fix(test): use valid synthetic Bink stream in report collision fixture - #8329

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

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

Conversation

@shoummobar

@shoummobar shoummobar commented Nov 23, 2026 •

Copy link
Copy Markdown

Summary

Narrows this PR to the unique fix identified during review: the report source collision test now builds a valid synthetic KB2n Bink stream, so the fixture reaches the intended source/report collision check instead of exiting during Bink parsing.

The overlapping viewer, stdout encoding, line-ending, and documentation changes were removed from this branch because they are already covered by other open PRs.

Verification

  • python -I tests/test_report_source_collision.py: 8/8 passed on the current branch.
  • Independent Windows and Linux checks of this fixture change also passed 8/8.
  • git diff --check origin/main...HEAD: passed.
  • python -I scripts/check_no_game_data.py tests/test_report_source_collision.py: passed. The fixture uses synthetic bytes only; no game files or GPU were 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
Contributor

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.

@shoummobar shoummobar changed the title test: use valid synthetic Bink stream in collision fixture fix: resolve cross-platform test failures and docs checks Nov 23, 2026
@Pierrot1398

Copy link
Copy Markdown

Tested 23609f4 on Windows 11 Pro (26300), Python 3.15.2, CPU only: pass.

Merged onto main 5d74c27 (no conflicts): python -I tests/test_report_source_collision.py fails on main and passes with this PR.

AI-assisted (Claude Code).

@shoummobar
shoummobar force-pushed the fix/test-streaming-and-line-endings branch from 23609f4 to bcee6c4 Compare November 23, 2026 21:28
@RJ2K1

RJ2K1 commented Nov 23, 2026

Copy link
Copy Markdown

Tested on Windows 11 Pro (10.0.26200), Python 3.12.3, Node 26.13.0.

PR head bcee6c494 (on top of main at 5d74c2723), all unit tests run with python -I tools/progress_dashboard.py --run-tests:

tests/test_*.py passed node --test tests/test_viewer_streaming.cjs
main 5d74c2723 415 / 442 56 / 57
this PR bcee6c494 422 / 442 57 / 57

Fixed by this PR (fail on main, pass with it): test_bvh_slot_check, test_docs_cli_flags, test_docs_links, test_report_source_collision, test_text_write_line_endings, test_tool_stdout_encoding, test_world_names, and the viewer test "Shift speeds the camera up and Ctrl slows it down".

No regressions: no test that passes on main fails with the PR.

Still failing on Windows with the PR (20): test_bink_index, test_bink_names, test_build_batch_launch, test_build_runtime_fallback, test_docs_design_rows, test_docs_env_vars, test_f64_conversion, test_f64_output_modifiers, test_first_look_paths, test_first_look_shim_report, test_gamedata_blobs, test_joaat_agreement, test_make_game_empty_translation, test_make_game_paths, test_make_game_resume, test_opus_tags, test_psin_names, test_ptr_truncation_census, test_runtime_paths, test_shader_checks. Some of these have their own open PRs (#9300/#9502 for LEONIDA_TLS_GA_PATCH, #9347 for the docs/README rows, #6474 for the f64 tests).

@dragoso

dragoso commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested the new head bcee6c494 merged onto main 5d74c2723 (clean merge) on Windows 11 Pro 26300, Python 3.11.0, Node 24.15.0, CPU only, against the same steps on main: pass, and four of the touched test files fail on main here and pass with this PR.

Test main 5d74c2723 this PR
python -I tests/test_docs_cli_flags.py 3/4, test_docs_name_existing_flags fails (docs/embedded_shaders.md:372, --ssa-r…) 4/4 OK
python -I tests/test_report_source_collision.py 7/8, test_a_distinct_report_path_still_works fails (bink_index: … not a Bink 2 stream (KB2)) 8/8 OK
python -I tests/test_world_names.py 29/30, test_an_unreadable_subtree_does_not_replace_the_dictionary fails (Windows Permission denied message) 30/30 OK
node --test tests/test_viewer_streaming.cjs 56/57, the Shift/Ctrl camera-speed test fails 57/57
python -m compileall -q make_game.py tools tests scripts clean clean

Not run: tests/test_tex_export.py and tests/test_user_sgpr_census.py (pytest-based; no pytest in this environment). No GPU or game files. AI-assisted (Claude Code).

@shoummobar
shoummobar force-pushed the fix/test-streaming-and-line-endings branch from bcee6c4 to bdfb4c1 Compare November 23, 2026 21:51
@shoummobar shoummobar changed the title fix: resolve cross-platform test failures and docs checks fix(test): use valid synthetic Bink stream in report collision fixture Nov 23, 2026
@Nevrche

Nevrche commented Nov 23, 2026

Copy link
Copy Markdown

Tested bdfb4c1f1 on Windows 10 Pro 22H2 (19045), Python 3.14.6, PowerShell 5.1: pass.

  • python -I tests/test_report_source_collision.py → Ran 8 tests in 1.554s — OK.
  • The PR's current diff is this one test file; no build or GPU work needed.

One note for the record, not a blocker: the docs-link checks fail on this tree (docs/dev-tools.md → ../runtime/README.md#a-600-frame-headless-guest-scene anchor not found, and docs/gpu_test_results.md → gpu-test-results/RX9070GRE.txt missing). They come from the branch's base, not from this diff — #9606 fixes the links.

AI-assisted.

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.