gpu: key warm-up bookkeeping by adapter #3

Manually merged
github merged 1 commit from gh-pr/3/head into gh-pr/3/base 2026-11-27 03:48:44 +00:00
Owner

@⁠nullrv on GitHub · 2026-11-26 21:26 UTC · original
nullrv:warm-adapter-key → main · +50 −5 · 3 files · 1 commits · merged 2026-11-26 22:15 UTC

What

Before this change, the "made before" fingerprint in warm-done.txt used only the translator and the driver version. Two cards on the same driver got the same fingerprint, so after a card switch warm --used skipped every pipeline while the new card's driver cache was empty (#1, "Switching cards").

The fingerprint now also includes the adapter's vendor, device, subsystem and revision IDs (Host::adapter_id, from GetDesc1). I left out the LUID because it changes on every boot. The summary line now prints the card as vendor:device. The format of warm-done.txt is unchanged, and each card keeps its own lines.

Side effect: the fingerprint changes for everyone, so the first warm --used after this change makes everything once, like after a translator change.

Measured

RTX 3060 Ti 8 GB and RTX 2060 6 GB (one enabled at a time), driver 621.40, diag build, README settings. warm --used each time:

Step Fingerprint, card Made before Made
3060 Ti, first 8226ac2b5579e3ed, 10de:2489 0 2,292 in 291 s (median 389 ms)
3060 Ti, again same 2,292 0
2060, first after the switch a2eace006281e3f9, 10de:1f08 0 2,292 in 259 s (median 357 ms)
2060, again same 2,292 0
3060 Ti, switched back 8226ac2b5579e3ed, 10de:2489 2,292 0
3060 Ti, 200 with --again same – 200 in 1 s (median 4.3 ms)
  • 2060 after the switch: it makes everything without --again. Before this change it skipped all 2,240.
  • 3060 Ti, switched back: it keeps its records, and the 4.3 ms median (against 389 ms cold) shows its driver cache survived the 2060's warm-up.

Pass.

Checks

  • cargo test --workspace --locked (new test: pipeline::known::tests::the_fingerprint_tells_cards_apart)
  • cargo clippy --workspace --all-targets --locked: no new warnings (also with --all-features; the three warnings in the touched files are on lines this change doesn't modify)
  • Ported code keeps its copyright lines: n/a, no ported code
  • cargo xtask policy: 260 files ok

Not in this PR: warm-bad.txt isn't keyed at all, so a pipeline that crashed one card's or driver's compiler is skipped everywhere. That's the same kind of bug, but fixing it changes that file's format, so I'd do it separately.

AI-assisted.

**@⁠nullrv** on GitHub · 2026-11-26 21:26 UTC · [original](https://github.com/brothernog/rota/pull/3) `nullrv:warm-adapter-key` → `main` · +50 −5 · 3 files · 1 commits · merged 2026-11-26 22:15 UTC ## What Before this change, the "made before" fingerprint in `warm-done.txt` used only the translator and the driver version. Two cards on the same driver got the same fingerprint, so after a card switch `warm --used` skipped every pipeline while the new card's driver cache was empty (#1, "Switching cards"). The fingerprint now also includes the adapter's vendor, device, subsystem and revision IDs (`Host::adapter_id`, from `GetDesc1`). I left out the LUID because it changes on every boot. The summary line now prints the card as `vendor:device`. The format of `warm-done.txt` is unchanged, and each card keeps its own lines. Side effect: the fingerprint changes for everyone, so the first `warm --used` after this change makes everything once, like after a translator change. ## Measured RTX 3060 Ti 8 GB and RTX 2060 6 GB (one enabled at a time), driver 621.40, `diag` build, README settings. `warm --used` each time: | Step | Fingerprint, card | Made before | Made | |---|---|---:|---:| | 3060 Ti, first | `8226ac2b5579e3ed`, `10de:2489` | 0 | 2,292 in 291 s (median 389 ms) | | 3060 Ti, again | same | 2,292 | 0 | | 2060, first after the switch | `a2eace006281e3f9`, `10de:1f08` | **0** | 2,292 in 259 s (median 357 ms) | | 2060, again | same | 2,292 | 0 | | 3060 Ti, switched back | `8226ac2b5579e3ed`, `10de:2489` | **2,292** | 0 | | 3060 Ti, 200 with `--again` | same | – | 200 in 1 s (median 4.3 ms) | - **2060 after the switch:** it makes everything without `--again`. Before this change it skipped all 2,240. - **3060 Ti, switched back:** it keeps its records, and the 4.3 ms median (against 389 ms cold) shows its driver cache survived the 2060's warm-up. Pass. ## Checks - [x] `cargo test --workspace --locked` (new test: `pipeline::known::tests::the_fingerprint_tells_cards_apart`) - [x] `cargo clippy --workspace --all-targets --locked`: no new warnings (also with `--all-features`; the three warnings in the touched files are on lines this change doesn't modify) - [x] Ported code keeps its copyright lines: n/a, no ported code - [x] `cargo xtask policy`: 260 files ok Not in this PR: `warm-bad.txt` isn't keyed at all, so a pipeline that crashed one card's or driver's compiler is skipped everywhere. That's the same kind of bug, but fixing it changes that file's format, so I'd do it separately. AI-assisted.
Two cards on one driver shared a fingerprint, so after a card switch
`warm --used` skipped every pipeline as made before while the new
card's driver cache was empty. Hash vendor, device, subsystem and
revision into it (not the LUID, which changes every boot), and print
the card in the summary line.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 03:48:42 +00:00
github manually merged commit 58f3daac27 into gh-pr/3/base 2026-11-27 03:48:44 +00:00
Author
Owner

@⁠brothernog on GitHub · 2026-11-26 21:55 UTC · original

Thanks, this is the fix #1 asked for. I read the diff: GetDesc1 through the adapter we already hold is fine, leaving the LUID out is right, and the test covers each field. Your table shows both the switch and the switch back behaving, which is the case that matters.

CI did not run because workflows on pull requests from forks need approval; I approved it and will merge once it is green. After that I will drop the --again advice from the README.

warm-bad.txt: agreed, a separate PR is the right call.

On your question in #1: no companion issue needed when a tracker item already covers the change. Linking the tracker, as you did, is enough.

This comment was AI-assisted.

**@⁠brothernog** on GitHub · 2026-11-26 21:55 UTC · [original](https://github.com/brothernog/rota/pull/3#issuecomment-7204196009) Thanks, this is the fix #1 asked for. I read the diff: `GetDesc1` through the adapter we already hold is fine, leaving the LUID out is right, and the test covers each field. Your table shows both the switch and the switch back behaving, which is the case that matters. CI did not run because workflows on pull requests from forks need approval; I approved it and will merge once it is green. After that I will drop the `--again` advice from the README. `warm-bad.txt`: agreed, a separate PR is the right call. On your question in #1: no companion issue needed when a tracker item already covers the change. Linking the tracker, as you did, is enough. This comment was AI-assisted.
This discussion has been locked. Commenting is limited to contributors.
No description provided.