fix(xgameruntime): guard frame_counter against 0 ms division, non-finite elapsed, and empty CSV path #375
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/375"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-26T13:46:05Z.
Summary
Fixes three edge-case bugs in
crates/anyxboxx-xgameruntime/src/frame_counter.rs:slowest_ms == 0.0:1000.0 / report.slowest_msproducedinfin trace logs and the window title (1 % bas inf) when frames completed within the same monotonic clock tick. Extractedlow_fps(slowest_ms: f64) -> f64returning0.0whenslowest_msis non-positive or non-finite.elapsedinsummarise:summariseonly checkedelapsed <= 0.0, acceptingf64::INFINITYorf64::NAN. Now rejects!elapsed.is_finite() || elapsed <= 0.0.ANYXBOXX_FPS_CSV:write_csvnow ignores an emptyANYXBOXX_FPS_CSVenvironment variable instead of attempting to open"".Verification
cargo fmt -p anyxboxx-xgameruntime -- --check— passcargo clippy -p anyxboxx-xgameruntime --no-deps --all-targets -- -D warnings— passcargo test -p anyxboxx-xgameruntime frame_counter::tests— all passed, 0 failed