test(crash): the crash window's renderer-order check cuts rx_start with srccut #1756

Open
jabbaxipil wants to merge 1 commit from jabbaxipil/Longshot:fix/crash-dialog-check-srccut into main
Contributor

Type: test · Risk: low · Tested on: Linux (Ubuntu 26.04.1), RTX 4070 · Needs: none

TL;DR

A follow-up to #1714, which is merged: its review left two small notes that did not block it, and this PR takes both. The check added there now reads the game's source with the project's own cutting helper, so if that code is renamed later the check says what is missing instead of stopping with a bare error. The crash report's documentation gains one clause. Nothing in the game changes; the check passes, and still fails when the fix from #1714 is taken out.

Breakdown

  • Who it helps: whoever next renames or reshapes the renderer's start-up code, and readers of the crash report's documentation.
  • What was wrong: the check from #1714 cut the source with plain string indexing, which the project's guide for agents says a new check should not do, and the docs did not say what the report's renderer means when the renderer fails to start.
  • What changes: the check cuts with tests/srccut.py; the docs say the renderer reported is the one chosen, whether or not it then started.
  • What does not change: the game, the crash window, the report, and what the check asserts.
  • How it was checked: the check passes (19 PASS lines), fails with #1714's fix reverted, and names the source and the marker when rx_start is renamed; the whole test run fails only where main does.
  • What is still open: nothing.
  • Risk: low: one test's source cut and one clause of documentation.

Why

HumanBean's review of #1714 (merged) left two notes, neither blocking:

  • AGENTS.md ("Tests read the source") asks a new check to cut source with tests/srccut.py, which stops with one message naming the source and the marker. The new check in tests/test_crash_dialog.py used str.index, so a renamed rx_start would stop it with a bare ValueError.
  • Since #1714, a start where the Vulkan back end loads but its start() fails reports "Vulkan" as the renderer (the one that was tried). The review suggested one clause in docs/crash-report-window.md to say so.

See #1714, #1263.

What changed

The renderer-order check cuts rx_start with between() from tests/srccut.py; the documentation gains the clause. No game code changes.

  • tests: source_checks() in tests/test_crash_dialog.py uses between(backend, "int rx_start(void *hwnd) {", "\n}\n") in place of two index slices. The assertion after it is unchanged. The file imports sys and srccut at the top, as the other checks that use it do.
  • docs: docs/crash-report-window.md: report: renderer is "the back end chosen, whether or not it then started".

Measurements

Verdict: nothing to measure: a game-free check and one clause of documentation; no game code changes.

Flags and settings

None.

Testing

Tested: on my own PC: Linux (Ubuntu 26.04.1, kernel 7.0.0-43), RTX 4070 (NVIDIA 615.71.09), Ryzen 7 5800X3D, 64 GB. Nothing here runs in the game, so no game run was made.

  • python3 -I -B tests/test_crash_dialog.py at this PR's head (after the rebase onto main @ 9ea65c7b): exit 0, 19 PASS lines.
  • With #1714's fix taken out of host/rx_backend.c (the report: renderer Vulkan line moved back after r->start(hwnd)), before the rebase, on main @ d30b9479: the check fails with AssertionError: report: renderer is logged before the Vulkan back end starts, so a crash while it prepares the shaders names it, as it did before this change.
  • With rx_start renamed to rx_begin in host/rx_backend.c, same base: the check stops with srccut: 'int rx_start(void *hwnd) {' is not in host/rx_backend.c (cut by tests/test_crash_dialog.py) (renamed or reshaped? update the check with the source).
  • python3 -I -B tests/test_doc_anchors.py at the head: doc anchors: 15, each resolves; the 13 rules' functions keep theirs.
  • python3 -I -B tests/run_all.py --jobs 8, before the rebase, on main @ d30b9479: 709 passed, 32 failed, 111 skipped. The same 32 fail on main @ d30b9479 in the same sitting: test_bug_report_defaults, test_capture_read_once, test_crt_options, test_damage_debug_menu, test_dev_packs, test_display_startup_failure, test_dlss_feature_size, test_failed_compile_keeps_objects, test_guest_imported, test_high_fps_fixes, test_host_guest_writes, test_hud_layout_row, test_libc_hooks, test_linux_preflight, test_linux_pressure, test_linux_update, test_log_open_failure, test_missing_nup, test_mods_size_table, test_pending_guest_import, test_pipeline_play_cache, test_prepare_cache_save, test_present_thread, test_profiling_mode, test_psychov35_fsr3_fg, test_readback_timeout_source, test_slow_frames, test_song_note_cue, test_upscaler_rows, test_vbytes, test_vcore_escape, test_walk_key (test_vbytes by timeout). On main three more failed (test_bug_report, test_crash_groups, test_hardware_report) only because that checkout had no Tooling folder beside it; with MAGICBEAN_TOOLING set all three pass there.

Not tested: the whole run_all.py after the rebase onto main @ 9ea65c7b (git range-diff shows the patch unchanged, and main's three new commits touch neither file of this PR nor host/rx_backend.c or tests/srccut.py). Windows: the changed check is plain Python, but I did not run it there.

Must be tested: None.

Risks

What could break: only this check: between() stops when the marker appears twice in host/rx_backend.c, where index took the first. It appears once today.

Turning it off: revert the commit.

Compatibility: Nothing changes.

Issues

See #1714
See #1263

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Docs updated.
**Type:** test · **Risk:** low · **Tested on:** Linux (Ubuntu 26.04.1), RTX 4070 · **Needs:** none ## TL;DR A follow-up to #1714, which is merged: its review left two small notes that did not block it, and this PR takes both. The check added there now reads the game's source with the project's own cutting helper, so if that code is renamed later the check says what is missing instead of stopping with a bare error. The crash report's documentation gains one clause. Nothing in the game changes; the check passes, and still fails when the fix from #1714 is taken out. ## Breakdown - **Who it helps:** whoever next renames or reshapes the renderer's start-up code, and readers of the crash report's documentation. - **What was wrong:** the check from #1714 cut the source with plain string indexing, which the project's guide for agents says a new check should not do, and the docs did not say what the report's renderer means when the renderer fails to start. - **What changes:** the check cuts with `tests/srccut.py`; the docs say the renderer reported is the one chosen, whether or not it then started. - **What does not change:** the game, the crash window, the report, and what the check asserts. - **How it was checked:** the check passes (19 PASS lines), fails with #1714's fix reverted, and names the source and the marker when `rx_start` is renamed; the whole test run fails only where main does. - **What is still open:** nothing. - **Risk:** low: one test's source cut and one clause of documentation. ## Why HumanBean's review of #1714 (merged) left two notes, neither blocking: - AGENTS.md ("Tests read the source") asks a new check to cut source with `tests/srccut.py`, which stops with one message naming the source and the marker. The new check in `tests/test_crash_dialog.py` used `str.index`, so a renamed `rx_start` would stop it with a bare `ValueError`. - Since #1714, a start where the Vulkan back end loads but its `start()` fails reports "Vulkan" as the renderer (the one that was tried). The review suggested one clause in `docs/crash-report-window.md` to say so. See #1714, #1263. ## What changed The renderer-order check cuts `rx_start` with `between()` from `tests/srccut.py`; the documentation gains the clause. No game code changes. - tests: `source_checks()` in `tests/test_crash_dialog.py` uses `between(backend, "int rx_start(void *hwnd) {", "\n}\n")` in place of two `index` slices. The assertion after it is unchanged. The file imports `sys` and `srccut` at the top, as the other checks that use it do. - docs: `docs/crash-report-window.md`: `report: renderer` is "the back end chosen, whether or not it then started". ## Measurements **Verdict:** nothing to measure: a game-free check and one clause of documentation; no game code changes. ### Flags and settings None. ## Testing **Tested:** on my own PC: Linux (Ubuntu 26.04.1, kernel 7.0.0-43), RTX 4070 (NVIDIA 615.71.09), Ryzen 7 5800X3D, 64 GB. Nothing here runs in the game, so no game run was made. - `python3 -I -B tests/test_crash_dialog.py` at this PR's head (after the rebase onto main @ 9ea65c7b): exit 0, 19 PASS lines. - With #1714's fix taken out of `host/rx_backend.c` (the `report: renderer Vulkan` line moved back after `r->start(hwnd)`), before the rebase, on main @ d30b9479: the check fails with `AssertionError: report: renderer is logged before the Vulkan back end starts, so a crash while it prepares the shaders names it`, as it did before this change. - With `rx_start` renamed to `rx_begin` in `host/rx_backend.c`, same base: the check stops with `srccut: 'int rx_start(void *hwnd) {' is not in host/rx_backend.c (cut by tests/test_crash_dialog.py) (renamed or reshaped? update the check with the source)`. - `python3 -I -B tests/test_doc_anchors.py` at the head: `doc anchors: 15, each resolves; the 13 rules' functions keep theirs`. - `python3 -I -B tests/run_all.py --jobs 8`, before the rebase, on main @ d30b9479: 709 passed, 32 failed, 111 skipped. The same 32 fail on main @ d30b9479 in the same sitting: test_bug_report_defaults, test_capture_read_once, test_crt_options, test_damage_debug_menu, test_dev_packs, test_display_startup_failure, test_dlss_feature_size, test_failed_compile_keeps_objects, test_guest_imported, test_high_fps_fixes, test_host_guest_writes, test_hud_layout_row, test_libc_hooks, test_linux_preflight, test_linux_pressure, test_linux_update, test_log_open_failure, test_missing_nup, test_mods_size_table, test_pending_guest_import, test_pipeline_play_cache, test_prepare_cache_save, test_present_thread, test_profiling_mode, test_psychov35_fsr3_fg, test_readback_timeout_source, test_slow_frames, test_song_note_cue, test_upscaler_rows, test_vbytes, test_vcore_escape, test_walk_key (`test_vbytes` by timeout). On main three more failed (test_bug_report, test_crash_groups, test_hardware_report) only because that checkout had no Tooling folder beside it; with `MAGICBEAN_TOOLING` set all three pass there. **Not tested:** the whole `run_all.py` after the rebase onto main @ 9ea65c7b (`git range-diff` shows the patch unchanged, and main's three new commits touch neither file of this PR nor `host/rx_backend.c` or `tests/srccut.py`). Windows: the changed check is plain Python, but I did not run it there. **Must be tested:** None. ## Risks **What could break:** only this check: `between()` stops when the marker appears twice in `host/rx_backend.c`, where `index` took the first. It appears once today. **Turning it off:** revert the commit. **Compatibility:** Nothing changes. ## Issues See #1714 See #1263 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Docs updated.
test(crash): the crash window's renderer-order check cuts rx_start with srccut
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
42284f137c
The check of where `report: renderer` is logged cut rx_start out of host/rx_backend.c with str.index, so a renamed or
reshaped rx_start stopped it with a bare ValueError. It now cuts with tests/srccut.py's between(), which names the
source and the marker (AGENTS.md, "Tests read the source"). The assertion is unchanged.

docs/crash-report-window.md says the renderer logged is the back end chosen, whether or not it then started: a Vulkan
back end that loads and fails to start is reported as "Vulkan". Both from the review of #1714.

Assisted-by: Claude Fable 5.2
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
This pull request has changes conflicting with the target branch.
  • docs/crash-report-window.md
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/crash-dialog-check-srccut:jabbaxipil-fix/crash-dialog-check-srccut'
git switch 'jabbaxipil-fix/crash-dialog-check-srccut'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1756
No description provided.