[pr-docs] How to A/B a change: docs/ab-testing.md, and the DARNER_BENCH_CSV row says what the file really holds #152
Loading…
Reference in a new issue
No description provided.
Delete branch "Jesper-A/Darner:up-ab-howto"
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?
Contributor role (optional)
What it changes
Docs only. No code, no switch, no default changes.
docs/ab-testing.md, "How to A/B a change" (140 lines), linked from the README's docs list. It explains how to say "this setting is faster or slower by N fps" so that someone else can repeat it. It uses only what Darner already has:DARNER_BENCH_CSV,DARNER_INPUT_RECORD/DARNER_INPUT_REPLAY,DARNER_KEYS/DARNER_KEYS_FROM,DARNER_EXIT_AFTER_WORLD_S,DARNER_HOT_AB,DARNER_AB,scripts/bench.ps1, the 5 sfpslog line and the 1 sframe times:log line. The method it states:DARNER_BENCH_CSVrow corrected. It said the file holds four columns (frame number, time, frame time, draw count).crates/darner-gpu/src/bench.rswrites about 100 columns, one row per rendered frame (the module doc there says "The earlier file had four columns ... this one ... adds the rest"). The row now says that and points to the column list at the top ofbench.rs.The method is the one used in an A/B report already posted here as an example of it in use: #76 (comment) (arms in the order A1, B1, B2, A2, one unscored warm-up run per arm, noise read from the two runs of each arm). The page itself contains no new measurements.
Note for the maintainer (not changed here). The README's
DARNER_INPUT_RECORDrow says it "records controller and keyboard input". The code records the pads' readings only (crates/darner-hle/src/modules/gameinput.rs, doc comment onDARNER_INPUT_RECORD: "The pads' readings written to a file"). The new page says "use a controller" for that reason. I left the README row alone to keep this PR to one change; say if you want it fixed here or in a follow-up. Keyboard routes go throughDARNER_KEYS.How it was tested
up-ab-howtoat054f0b1e0(three commits onmain57dea7f23).cargo xtask policyon054f0b1e0: passed (554 files ok).cargo clippy --workspace --all-targets --locked -- -D warnings, the same with--all-features,cargo test --workspace --locked. The diff is two Markdown files and touches no code. There is no CI upstream, so none of this was checked by CI.main57dea7f23(host.rsframe_times_lineand the 5 sfpsline,hot.rs,README.mdswitch rows). I did not start the game to see them in a log.scripts/bench.ps1needs the diagnostics build; the page says so, but I did not run it for this change.Checklist
main.docs/asset-policy.md.Spec dependence
bench.rswrites.DARNER_HOT_ABandDARNER_ABparagraphs say to use them only for a setting known to follow them, and to check the log.Checked for overlap
DARNER_BENCH_CSVrow). Open PRs that also editREADME.md(#147, #146, #145, #142, #140, #118, #110, #75, #59, #37, #36, #34, and our own #18 to #9) touch other rows. A trial merge of this branch with each head ended with no README conflict, except that #16, #12 and #9 already conflict withmainon their own, with or without this branch. Searches for "benchmark", "A/B" and "bench" found issues and PRs that use A/B runs (#145, #76, #2) but none that explain the method.Drafted with AI assistance (Claude Code).
WIP: [pr-docs] How to A/B a change: docs/ab-testing.md, and the DARNER_BENCH_CSV row says what the file really holdsto [pr-docs] How to A/B a change: docs/ab-testing.md, and the DARNER_BENCH_CSV row says what the file really holdsOne correction to the A/B guide at
054f0b1e0: the FPS line is printed about every five seconds, but its FPS value comes from the most recent roughly one-second counting interval. The frame counter and the log timer reset separately. Frame counter · Log timerI checked this against an archived 45 s run on an i5-13600KF and RTX 4070 Ti SUPER, native 2560×1440, frame generation off, build
8e4b9cd0. Nine printed samples averaged 27.24 FPS. The 1,217 frame intervals in the CSV gave 27.06 FPS over the window, with zero lost rows. The mean of 44 one-second p99s was 56.725 ms. The nearest-rank p99 across the individual frames was 66.845 ms. The CSV and log buckets have slightly different boundaries.Suggested wording: “For the median of the printed FPS samples, report the median and the number of lines. For average rendered FPS over the whole window, divide 1,000 × the number of complete frame intervals by their total duration in milliseconds. For whole-window p99, calculate it once from the individual frame intervals.”
Thanks for the careful check, you're right: the stats function returns early until about 1 s has passed (
host.rs:19337), resets its frame count there (:19376), and prints the fps line only every 5 s (:19516), so each printed value is the last ~1 s, not the 5 s.Fixed in
12ffb4230, mostly in your wording: the printed lines are reported as their median and count; whole-window average fps is 1000 × complete frame intervals / their totalframe_msfrom theDARNER_BENCH_CSVfile; and whole-window p99 is taken once from the individual frames, with a note that the mean of the per-second p99s comes out lower (your 56.7 ms against 66.8 ms, from your 4070 Ti SUPER run).Drafted with AI assistance (Claude Code).
One addition to the whole-window p99 guidance in
12ffb423: report the p99 over a common interval covered by both CSVs. The writer can drop rows under load (rows_lost, visible as gaps inhost_row), and the last quarter-second can be unflushed on title exit. Checking row continuity and the first and last timestamps lets you flag an incomplete window before comparing the two percentiles. Updated guide · CSV writer behaviourI tried the coverage check on four archived launches (A–B–B–A, RTX 4070 Ti SUPER, frame generation off). Each launch had two scored stages. I took the same 45.000 s from each stage marker and counted only frame intervals whose two endpoints were inside the window.
All eight windows had a CSV row on both sides, consecutive host_row values across both boundaries, zero rows_lost, and successful host presents. The 9,764 complete intervals reproduce the guide’s 66.845 ms whole-window p99 for B1 stage two.
Two controls caught different failures in all eight windows. Removing one interior row produced a host_row gap. Cutting the recording 250 ms before the end left row numbers consecutive, but the last timestamp exposed the missing tail. I’d include both checks in the guide. If either capture ends early, report the comparison as incomplete or state the shorter window used for both runs.
Thanks, both of you. Added in
7506dea2a, following tyr0nsur's note and akimfomin's controls: before comparing p99s, check each CSV is complete over the window (rows_lost, gaps inhost_row, the last quarter second possibly unflushed at exit). Compare A and B over the same interval covered by both files and count only intervals with both ends inside it. If a capture ends early, say the comparison is incomplete or use the shorter window for both runs. akimfomin showed on four archived A-B-B-A launches that thehost_rowcheck catches a lost interior row and the last timestamp catches a cut-off tail.Drafted with AI assistance (Claude Code).
[pr-docs] How to A/B a change: docs/ab-testing.md, and the DARNER_BENCH_CSV row says what the file really holdsto WIP: [pr-docs] How to A/B a change: docs/ab-testing.md, and the DARNER_BENCH_CSV row says what the file really holdsSecond-opinion review: merge as is once WIP is dropped. The CSV completeness check from
7506dea2amatches bench.rs: dropped rows are counted inrows_lostand leave ahost_rowgap, and the last quarter second can be lost at exit. Comparing over the window both files cover and checking the last timestamp is the right rule. The column names, both "frame times" log formats,hot-ab: segment, theDARNER_ABfeature gating,bench-remote, scripts\bench.ps1 and F2 all exist as described. No misleading text found.WIP: [pr-docs] How to A/B a change: docs/ab-testing.md, and the DARNER_BENCH_CSV row says what the file really holdsto [pr-docs] How to A/B a change: docs/ab-testing.md, and the DARNER_BENCH_CSV row says what the file really holdsView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.