monitor: fix frame interval parsing and add world-entry heuristic #261

Open
github-bot wants to merge 3 commits from github-bot/gh-261 into rx9070xt AGit
Owner

@⁠Adika713 on GitHub · 2026-11-26 14:09 UTC · original
Adika713:fix/monitor-frame-stats-v2 → rx9070xt · +588 −50 · 5 files · 3 commits · draft

## What and why

The low-memory monitored test script (_agent_reports/test-story-low-memory.ps1) needs to reliably capture frame cadence from diagnostics logs and avoid claiming world entry from black screenshots. PR #261 fixed the original ANSI parsing bug; this update aligns it with the new victory_gpu::frame interval_us=... diagnostics log and tightens the heuristic.

What is in it

  • Parse interval_us frame-interval diagnostics logs as presented-frame samples (counts toward frame stats/cadence).
  • Normalize ANSI/ESC residue around fields/values.
  • Keep legacy frame presented fallback.
  • Add/keep objective-but-heuristic world_entry_candidate + world_entry_reason: sustained presentation/intervals plus non-black screenshot signal. Explicitly labeled heuristic, not proof.

Tested

Hardware: Windows 11, AMD RX 6950 XT, Ryzen 5 3600, 32 GB RAM. No game run was performed for this update; parser was validated against existing logs.

Commands and results:

powershell -NoProfile -Command '$null = [scriptblock]::Create((Get-Content "_agent_reports/test-story-low-memory.ps1" -Raw)); Write-Output "ok"'
# ok

# Parser sanity check against existing captured log:
# F:\VIctory-Belobug-AMD\_agent_reports\logs\test-story-series-x-20261126-144423.err
# Result: count=5690 maxFrame=5691 presented=5703 median=32.708 p95=33.919 p99=38.441 longest=11866.59

Not tested

  • No new monitored game run after this change.
  • The world-entry heuristic is not validated against a known good world-entry session.
  • No FPS/stability/world-entry claim.

AI use

Prepared with AI assistance (OpenCode, gpt-5.4) on behalf of @⁠Adika713. I reviewed the diff and ran the parser checks above.

**@⁠Adika713** on GitHub · 2026-11-26 14:09 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/261) `Adika713:fix/monitor-frame-stats-v2` → `rx9070xt` · +588 −50 · 5 files · 3 commits · draft ## What and why The low-memory monitored test script (`_agent_reports/test-story-low-memory.ps1`) needs to reliably capture frame cadence from diagnostics logs and avoid claiming world entry from black screenshots. PR #261 fixed the original ANSI parsing bug; this update aligns it with the new `victory_gpu::frame interval_us=...` diagnostics log and tightens the heuristic. ## What is in it - Parse `interval_us` frame-interval diagnostics logs as presented-frame samples (counts toward frame stats/cadence). - Normalize ANSI/ESC residue around fields/values. - Keep legacy `frame presented` fallback. - Add/keep objective-but-heuristic `world_entry_candidate` + `world_entry_reason`: sustained presentation/intervals plus non-black screenshot signal. Explicitly labeled heuristic, not proof. ## Tested Hardware: Windows 11, AMD RX 6950 XT, Ryzen 5 3600, 32 GB RAM. No game run was performed for this update; parser was validated against existing logs. Commands and results: ```powershell powershell -NoProfile -Command '$null = [scriptblock]::Create((Get-Content "_agent_reports/test-story-low-memory.ps1" -Raw)); Write-Output "ok"' # ok # Parser sanity check against existing captured log: # F:\VIctory-Belobug-AMD\_agent_reports\logs\test-story-series-x-20261126-144423.err # Result: count=5690 maxFrame=5691 presented=5703 median=32.708 p95=33.919 p99=38.441 longest=11866.59 ``` ## Not tested - No new monitored game run after this change. - The world-entry heuristic is not validated against a known good world-entry session. - No FPS/stability/world-entry claim. ## AI use Prepared with AI assistance (OpenCode, gpt-5.4) on behalf of @⁠Adika713. I reviewed the diff and ran the parser checks above.
Parse interval_us/frame logs with ANSI-tolerant regex, count frame
presented lines, and record a heuristic world-entry candidate flag
(sustained presentation + non-black screenshots). Diagnostic only.

Prepared with AI assistance (OpenCode, Big Pickle) on behalf of @Adika713.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:12:51 +00:00
Count interval_us diagnostics logs as presented-frame samples, normalize ANSI/ESC residue, and only mark world-entry candidate when sustained presentation coexists with a non-black screenshot signal. Heuristic remains explicitly not proof.

Prepared with AI assistance (OpenCode, gpt-5.4) on behalf of @Adika713.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 22:43 UTC · original

Checked by reading the code on rx9070xt cd8dfc0 (head 5bda0c8). I did not build or run it.

  • The branch still sits on the history from before the force-push. Against 81ebb7b it adds one file, _agent_reports/test-story-low-memory.ps1. Those two commits apply to cd8dfc0 cleanly. A plain merge of the branch conflicts in crates/victory-gpu/src/ambient.rs, host.rs and pipeline/make.rs, so it needs a rebase onto rx9070xt.
  • a-publier is now at 4eb6cfd. frame.rs, queue.rs and xmem.rs are unchanged there, #272 and #297 are still open, and main is still not in a-publier. So the points below hold on 4eb6cfd too. The two script commits also merge cleanly onto 4eb6cfd.
  • Interval parsing (script line 190) needs interval_us. On cd8dfc0 the "frame interval" log is crates/victory-gpu/src/frame.rs:85. It is logged from set_interval, when the title sets its rate, with interval= as a Duration and no interval_us field. interval_us comes only from #272 (crates/victory-gpu/src/queue.rs:1022 at 3c18705), as a debug line behind cfg(feature = "diagnostics"). So the script needs #272 and a diagnostics build. The PR body names the log but not #272; it should link or depend on it.
  • The fallback (line 198) matches "frame presented" at crates/victory-gpu/src/queue.rs:967. That line is only logged when the frame count is a power of two (queue.rs:947), so a 5000-frame run gives 13 lines. Line 229 needs at least 100 presented lines and 100 intervals. On cd8dfc0 that means world_entry_candidate is always False, with reason insufficient_present_samples (or no if no frame was logged).
  • Line 265 uses "e" inside a double-quoted string. Windows PowerShell 5.1 has no "e" escape and reads it as a plain e. The regex then becomes e[[0-9;]*m, which deletes "em" pairs: memory allocation of comes out as mory allocation of. The syntax check in the PR body runs powershell (5.1), and a parse check does not catch this. [char]27 or \x1b (as on line 186) works on both versions.
  • Lines 71-73 and 77: VICTORY_MEMORY_LOG_SECS and the victory::memory log target are not on cd8dfc0 (git grep finds nothing). They are on main (crates/victory-hle/src/modules/xmem.rs:1635,1724 at 4f62c2a), which a-publier does not contain. VICTORY_LAZY_PHYSICAL and VICTORY_FILE_PHYSICAL come from #297 (crates/victory-hle/src/modules/xmem.rs:719,727 at b82a5db). On cd8dfc0 these four settings do nothing.
  • Lines 108 and 120: the screenshot is saved as frame-<nnnn>s.png, but the summary line names it shot_<n>s.png. The summary therefore names files that do not exist.

Not checked: running the script, or the parser against a log from cd8dfc0.

**@⁠adrianmjim** on GitHub · 2026-11-26 22:43 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/261#issuecomment-7204935082) Checked by reading the code on rx9070xt cd8dfc0 (head 5bda0c8). I did not build or run it. - The branch still sits on the history from before the force-push. Against 81ebb7b it adds one file, `_agent_reports/test-story-low-memory.ps1`. Those two commits apply to cd8dfc0 cleanly. A plain merge of the branch conflicts in `crates/victory-gpu/src/ambient.rs`, `host.rs` and `pipeline/make.rs`, so it needs a rebase onto rx9070xt. - a-publier is now at 4eb6cfd. `frame.rs`, `queue.rs` and `xmem.rs` are unchanged there, #272 and #297 are still open, and `main` is still not in a-publier. So the points below hold on 4eb6cfd too. The two script commits also merge cleanly onto 4eb6cfd. - Interval parsing (script line 190) needs `interval_us`. On cd8dfc0 the "frame interval" log is `crates/victory-gpu/src/frame.rs:85`. It is logged from `set_interval`, when the title sets its rate, with `interval=` as a Duration and no `interval_us` field. `interval_us` comes only from #272 (`crates/victory-gpu/src/queue.rs:1022` at 3c18705), as a debug line behind `cfg(feature = "diagnostics")`. So the script needs #272 and a diagnostics build. The PR body names the log but not #272; it should link or depend on it. - The fallback (line 198) matches `"frame presented"` at `crates/victory-gpu/src/queue.rs:967`. That line is only logged when the frame count is a power of two (`queue.rs:947`), so a 5000-frame run gives 13 lines. Line 229 needs at least 100 presented lines and 100 intervals. On cd8dfc0 that means `world_entry_candidate` is always False, with reason `insufficient_present_samples` (or `no` if no frame was logged). - Line 265 uses "`e" inside a double-quoted string. Windows PowerShell 5.1 has no "`e" escape and reads it as a plain `e`. The regex then becomes `e[[0-9;]*m`, which deletes "em" pairs: `memory allocation of` comes out as `mory allocation of`. The syntax check in the PR body runs `powershell` (5.1), and a parse check does not catch this. `[char]27` or `\x1b` (as on line 186) works on both versions. - Lines 71-73 and 77: `VICTORY_MEMORY_LOG_SECS` and the `victory::memory` log target are not on cd8dfc0 (`git grep` finds nothing). They are on `main` (`crates/victory-hle/src/modules/xmem.rs:1635,1724` at 4f62c2a), which a-publier does not contain. `VICTORY_LAZY_PHYSICAL` and `VICTORY_FILE_PHYSICAL` come from #297 (`crates/victory-hle/src/modules/xmem.rs:719,727` at b82a5db). On cd8dfc0 these four settings do nothing. - Lines 108 and 120: the screenshot is saved as `frame-<nnnn>s.png`, but the summary line names it `shot_<n>s.png`. The summary therefore names files that do not exist. Not checked: running the script, or the parser against a log from cd8dfc0.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/ambient.rs
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/pipeline/make.rs
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 origin '+refs/pull/261/head:github-bot/gh-261'
git switch 'github-bot/gh-261'

Merge

Merge the changes and update on Forgejo.
git switch 'rx9070xt'
git merge --no-ff 'github-bot/gh-261'
git switch 'github-bot/gh-261'
git rebase 'rx9070xt'
git switch 'rx9070xt'
git merge --ff-only 'github-bot/gh-261'
git switch 'github-bot/gh-261'
git rebase 'rx9070xt'
git switch 'rx9070xt'
git merge --no-ff 'github-bot/gh-261'
git switch 'rx9070xt'
git merge --squash 'github-bot/gh-261'
git switch 'rx9070xt'
git merge --ff-only 'github-bot/gh-261'
git switch 'rx9070xt'
git merge 'github-bot/gh-261'
git push origin 'rx9070xt'
This discussion has been locked. Commenting is limited to contributors.
No description provided.