Index write-watch coverage for large GPU submissions #5

Closed
github-bot wants to merge 1 commit from gh-pr/5/head into gh-pr/5/base
Owner

@⁠Lkxex on GitHub · 2026-11-26 10:13 UTC · original
Lkxex:perf/index-submission-write-watch → main · +104 −14 · 1 files · 1 commits · closed without merging

What changes

The submission preparation thread repeatedly checks whether a refresh range is already covered by a successful Windows write-watch query. Large submissions scanned the full list for each hit or miss. Keep the short linear path for up to 32 ranges and switch to an ordered index beyond that. Retain the coverage of the original individual queries, including when two queries overlap or touch. Skip rebuilding an ahead batch while a submission's retained snapshot already stands.

This targets the CPU submission path described in the project measurements.

Tested

Windows x64, Ryzen 5 5600, Rust 1.98.1. Median of 11 samples, eight iterations per sample. Each iteration builds the range set and does 20,000 identical seeded lookups. The optimized Rust microbenchmark measures this operation only.

Ranges Linear New path
16 0.203 ms 0.196 ms
64 0.498 ms 0.399 ms
256 1.559 ms 0.559 ms
1024 5.898 ms 0.787 ms
  • cargo test --locked -p victory-gpu --features diagnostics watch:: -- --test-threads=1: 43 passed, 0 failed.
  • cargo check --locked -p victory --features diagnostics: passed.
  • New regression checks coverage against the linear reference before and after switching to the index.

Not tested

In-game frame times, FPS, and visual behavior. The measured savings are from the lookup workload above.

AI use

OpenAI Codex (GPT-6.2 Sol) assisted with implementation and verification.

**@⁠Lkxex** on GitHub · 2026-11-26 10:13 UTC · [original](https://github.com/DoubleGhosty/cool_fox/pull/5) `Lkxex:perf/index-submission-write-watch` → `main` · +104 −14 · 1 files · 1 commits · closed without merging ## What changes The submission preparation thread repeatedly checks whether a refresh range is already covered by a successful Windows write-watch query. Large submissions scanned the full list for each hit or miss. Keep the short linear path for up to 32 ranges and switch to an ordered index beyond that. Retain the coverage of the original individual queries, including when two queries overlap or touch. Skip rebuilding an ahead batch while a submission's retained snapshot already stands. This targets the CPU submission path described in [the project measurements](https://github.com/DoubleGhosty/cool_fox/blob/f4b48ad766ddbec1a1867022cd42f7645b0dd55e/docs/findings.md). ## Tested Windows x64, Ryzen 5 5600, Rust 1.98.1. Median of 11 samples, eight iterations per sample. Each iteration builds the range set and does 20,000 identical seeded lookups. The optimized Rust microbenchmark measures this operation only. | Ranges | Linear | New path | | ---: | ---: | ---: | | 16 | 0.203 ms | 0.196 ms | | 64 | 0.498 ms | 0.399 ms | | 256 | 1.559 ms | 0.559 ms | | 1024 | 5.898 ms | 0.787 ms | - `cargo test --locked -p victory-gpu --features diagnostics watch:: -- --test-threads=1`: 43 passed, 0 failed. - `cargo check --locked -p victory --features diagnostics`: passed. - New regression checks coverage against the linear reference before and after switching to the index. ## Not tested In-game frame times, FPS, and visual behavior. The measured savings are from the lookup workload above. ## AI use OpenAI Codex (GPT-6.2 Sol) assisted with implementation and verification.
Keep the linear path for up to 32 ranges. Preserve the exact coverage of individual queries when switching to the ordered index.

Assisted-by: Codex (GPT-6.2 Sol)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 06:06:21 +00:00
github-bot closed this pull request 2026-11-27 06:06:22 +00:00
Author
Owner

@⁠DoubleGhosty on GitHub · 2026-11-26 20:28 UTC · original

Thanks for this PR! The write-watch submission preparation path in victory-gpu has since been refactored in main to use sharded Notes and concurrent Ahead tracking with fine-grained locking, resolving the large submission scan overhead. Closing for now.

**@⁠DoubleGhosty** on GitHub · 2026-11-26 20:28 UTC · [original](https://github.com/DoubleGhosty/cool_fox/pull/5#issuecomment-7202725957) Thanks for this PR! The write-watch submission preparation path in victory-gpu has since been refactored in main to use sharded Notes and concurrent Ahead tracking with fine-grained locking, resolving the large submission scan overhead. Closing for now.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.