[pr-fix] Count crash records for the measured benchmark run #173

Open
akimfomin wants to merge 1 commit from akimfomin/Darner:codex/bench-crash-records into main
First-time contributor

Contributor role (optional)

Fluxer ID omitted.

What it changes

The benchmark read only data/crashes.log and counted every line. A title-specific crash file could be missed entirely, while a three-line record in the old layout could inflate the count. A seeded run directory can also contain earlier failures.

This change reads both the flat and title-ID layouts, counts record headers and attributes them using the play log’s PID, UTC start and the benchmark’s observation cutoff. Recalculating an older summary without a saved cutoff uses its previous modification time, then preserves that value. If records exist but the run’s process identity is unknown, the summary marks the count as unknown.

How it was tested

  • Tested on Windows 11 against main 57dea7f236. The published tree at db3d904237 matches the locally tested tree at 3aa7267713.
  • Invoke-Pester -Script scripts/tests/bench-crashes.Tests.ps1 passed 4/4 under Windows PowerShell 5.1 and PowerShell 7.6. Cases cover multiline records, copied history, PID reuse, missing process identity and missing crash logs. cargo run --quiet --locked --offline -p xtask -- policy passed.
  • Replayed an archived three-line crash record in its title-ID directory with its matching play-log filename through scripts/bench.ps1 -From. Main reported 0 and the patched summary reported 1. The reproduction used a synthetic console-output file to supply the original play-log filename.
  • Old summaries whose timestamps were manually changed have a weaker upper bound. The result counts recorded events. A fresh game run and the three workspace-wide Clippy/test gates were outside this verification.

Checklist

  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR’s dependencies below.
    • Depends on: none.

Checked for overlap

  • Searched open and closed issues and PRs for the symptom and checked open PRs touching this script.
  • #172 changes per-frame window selection in the same file. These two changes are independent and a local Git trial merge completed without conflicts.
## Contributor role (optional) Fluxer ID omitted. ## What it changes The benchmark read only `data/crashes.log` and counted every line. A title-specific crash file could be missed entirely, while a three-line record in the old layout could inflate the count. A seeded run directory can also contain earlier failures. This change reads both the flat and title-ID layouts, counts record headers and attributes them using the play log’s PID, UTC start and the benchmark’s observation cutoff. Recalculating an older summary without a saved cutoff uses its previous modification time, then preserves that value. If records exist but the run’s process identity is unknown, the summary marks the count as unknown. ## How it was tested - Tested on Windows 11 against main `57dea7f236`. The published tree at `db3d904237` matches the locally tested tree at `3aa7267713`. - `Invoke-Pester -Script scripts/tests/bench-crashes.Tests.ps1` passed 4/4 under Windows PowerShell 5.1 and PowerShell 7.6. Cases cover multiline records, copied history, PID reuse, missing process identity and missing crash logs. `cargo run --quiet --locked --offline -p xtask -- policy` passed. - Replayed an archived three-line crash record in its title-ID directory with its matching play-log filename through `scripts/bench.ps1 -From`. Main reported **0** and the patched summary reported **1**. The reproduction used a synthetic console-output file to supply the original play-log filename. - Old summaries whose timestamps were manually changed have a weaker upper bound. The result counts recorded events. A fresh game run and the three workspace-wide Clippy/test gates were outside this verification. ## Checklist - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR’s dependencies below. - Depends on: none. ## Checked for overlap - [x] Searched open and closed issues and PRs for the symptom and checked open PRs touching this script. - #172 changes per-frame window selection in the same file. These two changes are independent and a local Git trial merge completed without conflicts.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'codex/bench-crash-records:akimfomin-codex/bench-crash-records'
git switch 'akimfomin-codex/bench-crash-records'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'akimfomin-codex/bench-crash-records'
git switch 'akimfomin-codex/bench-crash-records'
git rebase 'main'
git switch 'main'
git merge --ff-only 'akimfomin-codex/bench-crash-records'
git switch 'akimfomin-codex/bench-crash-records'
git rebase 'main'
git switch 'main'
git merge --no-ff 'akimfomin-codex/bench-crash-records'
git switch 'main'
git merge --squash 'akimfomin-codex/bench-crash-records'
git switch 'main'
git merge --ff-only 'akimfomin-codex/bench-crash-records'
git switch 'main'
git merge 'akimfomin-codex/bench-crash-records'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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
TrustNo1/Darner!173
No description provided.