D3D12.X: XCL_ACTIVITY counts and times the per-draw buffer mirror sync #2406

Open
KOLESNiii wants to merge 1 commit from upstream-pr/2416 into main
KOLESNiii commented 2026-11-25 18:10:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-25T18:10:38Z.


Once any buffer mirror exists, list_x::sync_title_buffers runs on every draw, and nothing reported what it costs. With XCL_ACTIVITY=1 it now logs one line every 2 s in which it ran. This is diagnostics only, with no change in behaviour, and without XCL_ACTIVITY the sync takes no time stamps and touches no counter, so the other parts of #2389 have before and after numbers.

Fixes #2391. Part of #2389.

What is in it

  • crates/xcl/src/hle/d3d12x/list_x.rs: counters for draws synced and those with a mirror, copies (whole buffers), bytes copied, indices scanned, readable() calls (those over 16 pages), the time in readable() and its slowest call, and the time in the function. The old body is now sync_mirrors, unchanged apart from the counters. sync_title_buffers still returns first when no mirror exists.
  • The counters are off unless XCL_ACTIVITY is set: host_main calls enable_sync_activity() before it starts the activity thread; until then sync_title_buffers, sync_readable() and sync_count() only check one relaxed AtomicBool (no Instant::now(), no shared atomics).
  • crates/xcl/src/host.rs: the buffer mirrors (2 s): … line in the XCL_ACTIVITY thread, printed whenever any of its counters moved (list_x::sync_row_due), also with no draw synced: the counters of a sync still running at the sample, or stalled for over 2 s, land before its draw is counted, and its slowest readable() would otherwise be dropped with the skipped row.
  • One addition to the list in #2391: the slowest readable() call. The measurement on #2389 found single calls of 16 pages or fewer taking 1–9 ms, which the totals average away.

Tested

  • NVIDIA RTX 2070 SUPER (driver 32.0.16.2140), AMD Ryzen 5 3600XT, Windows 11 build 26300, Rust 1.100.0, debug.
  • Current head c6562a0c (rebased onto main 765b2c5b to resolve conflicts): the suite has not been rerun on it; the counts below are from the earlier heads they name.
  • Rebased onto main 336fddda on 2026-11-28. cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4 on 68227880: 2124 passed, 9 failed, 48 ignored; 25 SKIPPED (21 no wave64, 3 refused #1426 forms, 1 no heap windows). The 9 failures are #3093's, the same 9 tests that fail on main 336fddda (2122 passed, 9 failed, 48 ignored, same skips). The results below are from before the rebase.
  • cargo test --workspace -- --test-threads=4 on 49f0474: 1425 passed, 0 failed, 46 ignored; 25 SKIPPED (21 no wave64, 3 refused #1426 forms, 1 no heap windows, as on main).
  • New test list_x::tests::the_mirror_sync_counts_only_once_xcl_activity_enables_it: with the counters off, sync_readable() / sync_count() leave every counter and the slowest time at their values; after enable_sync_activity() they count.
  • New test list_x::tests::a_mirror_sync_row_with_no_finished_draw_is_still_logged: a row with readable() work or a slowest time but no draw synced is due, as is one with only a draw.

Regression run

Current head c6562a0c, rebased onto main 765b2c5b on 2026-11-28 to resolve conflicts with main. RTX 2070 SUPER, the retail game, 60 s, XCL_PRESS_AT=25:A, XCL_PREPARE=0 (no startup shader preparation), release builds; each run started from a copy of the same DXIL cache (one queue job: main, then PR heads one after the other).

main:

xcl-smoke v1
commit: 7db2f391cefd748d47c7de63d50dd43ebb852185
gpu: NVIDIA GeForce RTX 2070 SUPER
title: retail game
seconds: 60
exit: 0x0
frames shown: 1530 (PresentX 1530)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 17023 MB

This PR's head:

xcl-smoke v1
commit: c6562a0c87c0d4ad30886dacd397499b9a2b8c08
gpu: NVIDIA GeForce RTX 2070 SUPER
title: retail game
seconds: 60
exit: 0x0
frames shown: 1533 (PresentX 1533)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 17215 MB

Not tested

  • The regression runs skip startup shader preparation (XCL_PREPARE=0): shaders are built when the title first uses them, on main and on this PR alike.
  • The new line itself: this smoke run made no mirrors (the title's learned coherent window was in place), so the code under the counters did not run. Its numbers on #2389 come from an earlier local version of the same counters, not from this commit.
  • The cost of the off path was not measured separately: it is one relaxed load of a bool that is written once at start-up, and the smoke run did not reach the mirror sync anyway.
  • AMD and Intel GPUs, wave64.

AI use

  • Claude Code with Claude Opus 5.5: wrote the code, the commit message and this description, and ran the tests and the smoke runs.
  • Claude Code (Claude Opus 5.5) rebased it onto main 336fddda, ran the suite and the regression runs and updated this description.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5496646481 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2416). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-25T18:10:38Z. --- Once any buffer mirror exists, `list_x::sync_title_buffers` runs on every draw, and nothing reported what it costs. With `XCL_ACTIVITY=1` it now logs one line every 2 s in which it ran. This is diagnostics only, with no change in behaviour, and without `XCL_ACTIVITY` the sync takes no time stamps and touches no counter, so the other parts of #2389 have before and after numbers. Fixes #2391. Part of #2389. **What is in it** - `crates/xcl/src/hle/d3d12x/list_x.rs`: counters for draws synced and those with a mirror, copies (whole buffers), bytes copied, indices scanned, `readable()` calls (those over 16 pages), the time in `readable()` and its slowest call, and the time in the function. The old body is now `sync_mirrors`, unchanged apart from the counters. `sync_title_buffers` still returns first when no mirror exists. - The counters are off unless `XCL_ACTIVITY` is set: `host_main` calls `enable_sync_activity()` before it starts the activity thread; until then `sync_title_buffers`, `sync_readable()` and `sync_count()` only check one relaxed `AtomicBool` (no `Instant::now()`, no shared atomics). - `crates/xcl/src/host.rs`: the `buffer mirrors (2 s): …` line in the `XCL_ACTIVITY` thread, printed whenever any of its counters moved (`list_x::sync_row_due`), also with no draw synced: the counters of a sync still running at the sample, or stalled for over 2 s, land before its draw is counted, and its slowest `readable()` would otherwise be dropped with the skipped row. - One addition to the list in #2391: the slowest `readable()` call. The measurement on #2389 found single calls of 16 pages or fewer taking 1–9 ms, which the totals average away. **Tested** - NVIDIA RTX 2070 SUPER (driver 32.0.16.2140), AMD Ryzen 5 3600XT, Windows 11 build 26300, Rust 1.100.0, debug. - Current head `c6562a0c` (rebased onto `main` `765b2c5b` to resolve conflicts): the suite has not been rerun on it; the counts below are from the earlier heads they name. - Rebased onto `main` `336fddda` on 2026-11-28. `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4` on `68227880`: 2124 passed, 9 failed, 48 ignored; 25 SKIPPED (21 `no wave64`, 3 refused #1426 forms, 1 `no heap windows`). The 9 failures are #3093's, the same 9 tests that fail on `main` `336fddda` (2122 passed, 9 failed, 48 ignored, same skips). The results below are from before the rebase. - `cargo test --workspace -- --test-threads=4` on 49f0474: 1425 passed, 0 failed, 46 ignored; 25 SKIPPED (21 `no wave64`, 3 refused #1426 forms, 1 `no heap windows`, as on `main`). - New test `list_x::tests::the_mirror_sync_counts_only_once_xcl_activity_enables_it`: with the counters off, `sync_readable()` / `sync_count()` leave every counter and the slowest time at their values; after `enable_sync_activity()` they count. - New test `list_x::tests::a_mirror_sync_row_with_no_finished_draw_is_still_logged`: a row with `readable()` work or a slowest time but no draw synced is due, as is one with only a draw. **Regression run** Current head `c6562a0c`, rebased onto `main` `765b2c5b` on 2026-11-28 to resolve conflicts with `main`. RTX 2070 SUPER, the retail game, 60 s, `XCL_PRESS_AT=25:A`, `XCL_PREPARE=0` (no startup shader preparation), release builds; each run started from a copy of the same DXIL cache (one queue job: `main`, then PR heads one after the other). `main`: ``` xcl-smoke v1 commit: 7db2f391cefd748d47c7de63d50dd43ebb852185 gpu: NVIDIA GeForce RTX 2070 SUPER title: retail game seconds: 60 exit: 0x0 frames shown: 1530 (PresentX 1530) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 17023 MB ``` This PR's head: ``` xcl-smoke v1 commit: c6562a0c87c0d4ad30886dacd397499b9a2b8c08 gpu: NVIDIA GeForce RTX 2070 SUPER title: retail game seconds: 60 exit: 0x0 frames shown: 1533 (PresentX 1533) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 17215 MB ``` **Not tested** - The regression runs skip startup shader preparation (`XCL_PREPARE=0`): shaders are built when the title first uses them, on `main` and on this PR alike. - The new line itself: this smoke run made no mirrors (the title's learned coherent window was in place), so the code under the counters did not run. Its numbers on #2389 come from an earlier local version of the same counters, not from this commit. - The cost of the off path was not measured separately: it is one relaxed load of a bool that is written once at start-up, and the smoke run did not reach the mirror sync anyway. - AMD and Intel GPUs, wave64. **AI use** - Claude Code with Claude Opus 5.5: wrote the code, the commit message and this description, and ran the tests and the smoke runs. - Claude Code (Claude Opus 5.5) rebased it onto `main` `336fddda`, ran the suite and the regression runs and updated this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
emirduran707 commented 2026-11-25 20:08:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T19:27:32Z.


Independent AMD RDNA4 (native wave64) test report on exact head b52e97f619cce2afbe09ad9715490dcee30e4e1c (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1273 passed, 2 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 seed 722 and fuzz_validate_and_gpu_3 seed 1599) are pre-existing on unmodified main on this GPU.

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: b52e97f619cce2afbe09ad9715490dcee30e4e1c
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1564 (PresentX 1564)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13930 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • XCL_ACTIVITY=1 log output; D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7172324364 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2416#issuecomment-7172324364). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-25T19:27:32Z. --- Independent AMD RDNA4 (native wave64) test report on exact head `b52e97f619cce2afbe09ad9715490dcee30e4e1c` (clean detached checkout, no local changes). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2602.17; tests debug, smoke release. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: **1273 passed, 2 failed, 46 ignored; 8 SKIPPED** (6 in `lower_dxil::tests::{f16,f32}_programs_on_the_gpu` refused by per-lane form; `heap_window_out_of_memory_falls_back_to_the_switch_form`; `pso_measurement_compiles_an_exact_synthetic_record`). All native wave64 GPU tests ran and passed. - The 2 failures (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` seed 722 and `fuzz_validate_and_gpu_3` seed 1599) are pre-existing on unmodified `main` on this GPU. **Regression run** (60 s retail-title smoke, `XCL_NETWORK=0`, release) ``` xcl-smoke v1 commit: b52e97f619cce2afbe09ad9715490dcee30e4e1c gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1564 (PresentX 1564) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13930 MB ``` (Matched `main` `68a284a` baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.) **Not tested** - `XCL_ACTIVITY=1` log output; D3D12 debug layer; Intel GPUs. **AI use** - Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
DavidM1911 commented 2026-11-25 20:08:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T19:30:14Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7172387027 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2416#issuecomment-7172387027). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T19:30:14Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
bmjask commented 2026-11-25 20:43:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:43:14Z.

Review: COMMENTED


P2: instrumentation is active regardless of XCL_ACTIVITY. sync_title_buffers always creates an Instant and updates atomics once mirrors exist; sync_readable always times/updates several atomics and each copy adds more. XCL_ACTIVITY only gates the logging thread, so normal users pay timing and shared-atomic contention on the per-draw mirror path despite the diagnostics-only/no-behavior-change claim. Gate all accounting behind an enabled fast path, then measure/test overhead-off. Current head also has no visible Windows Build/test and the smoke did not execute these counters.

<!-- greyfinch-sync:ivall/xcl:review:6064714902 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2416#pullrequestreview-6064714902). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-25T20:43:14Z. **Review:** COMMENTED --- P2: instrumentation is active regardless of XCL_ACTIVITY. sync_title_buffers always creates an Instant and updates atomics once mirrors exist; sync_readable always times/updates several atomics and each copy adds more. XCL_ACTIVITY only gates the logging thread, so normal users pay timing and shared-atomic contention on the per-draw mirror path despite the diagnostics-only/no-behavior-change claim. Gate all accounting behind an enabled fast path, then measure/test overhead-off. Current head also has no visible Windows Build/test and the smoke did not execute these counters.
thehollowedone commented 2026-11-25 21:05:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T20:24:28Z.


Independent Windows/NVIDIA test on #2416 head b52e97f (clean detached worktree): cargo build --offline --locked --workspace, then cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 passed: 1,275 passed, 0 failed, 46 ignored across 23 test binaries. The log also had 26 explicit SKIPPED notices: 21 no wave64, three unsupported per-lane #1426 forms, one driver-cache-disable test needing Windows Developer Mode/SDK support, and one no heap windows. GPU tests that did not skip ran on the RTX 3080 Ti.

Setup: Windows 11 build 26300; RTX 3080 Ti 12 GB, driver 621.35; Ryzen 7 9800X3D, 32 GB RAM; Rust 1.99.1; DXC 1.8.2502.11 from Windows SDK 10.0.26100.0. XCL_NETWORK=0, XCL_ADAPTER=RTX 3080 Ti, and XCL_DXC_DIR pointed to that SDK's x64 bin directory. The first cargo test invocation had two launcher e2e failures because it preceded cargo build --workspace and the standalone test-title binaries were absent; the complete rerun after the build passed.

Not tested: the new XCL_ACTIVITY=1 buffer-mirror log line (the suite did not establish that a draw created a mirror), retail smoke, or an AMD GPU. This is an independent suite check, not a claim that the new counters were exercised.

AI-assisted: Codex (GPT-6, exact variant unavailable) inspected the diff, ran the build and tests, checked the counts, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7173625385 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2416#issuecomment-7173625385). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-25T20:24:28Z. --- Independent Windows/NVIDIA test on [#2416 head `b52e97f`](https://github.com/xcl-dev/xcl/commit/b52e97f619cce2afbe09ad9715490dcee30e4e1c) (clean detached worktree): `cargo build --offline --locked --workspace`, then `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4` **passed: 1,275 passed, 0 failed, 46 ignored** across 23 test binaries. The log also had 26 explicit `SKIPPED` notices: 21 no wave64, three unsupported per-lane #1426 forms, one driver-cache-disable test needing Windows Developer Mode/SDK support, and one no heap windows. GPU tests that did not skip ran on the RTX 3080 Ti. Setup: Windows 11 build 26300; RTX 3080 Ti 12 GB, driver 621.35; Ryzen 7 9800X3D, 32 GB RAM; Rust 1.99.1; DXC 1.8.2502.11 from Windows SDK 10.0.26100.0. `XCL_NETWORK=0`, `XCL_ADAPTER=RTX 3080 Ti`, and `XCL_DXC_DIR` pointed to that SDK's x64 bin directory. The first `cargo test` invocation had two launcher e2e failures because it preceded `cargo build --workspace` and the standalone test-title binaries were absent; the complete rerun after the build passed. Not tested: the new `XCL_ACTIVITY=1` buffer-mirror log line (the suite did not establish that a draw created a mirror), retail smoke, or an AMD GPU. This is an independent suite check, not a claim that the new counters were exercised. AI-assisted: Codex (GPT-6, exact variant unavailable) inspected the diff, ran the build and tests, checked the counts, and drafted this report.
KOLESNiii commented 2026-11-25 23:09:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-25T22:15:17Z.


Thanks, agreed: XCL_ACTIVITY only gated the logging thread. Fixed in 15f4019 (squashed into the PR's commit):

  • host_main calls list_x::enable_sync_activity() before it starts the activity thread. Until then sync_title_buffers, sync_readable() and sync_count() check one relaxed AtomicBool and go straight to the untimed path: no Instant::now(), no shared atomics.
  • New test the_mirror_sync_counts_only_once_xcl_activity_enables_it: with the counters off, sync_readable() / sync_count() leave every counter and the slowest time unchanged. After enable_sync_activity() they count.
  • cargo test --workspace -- --test-threads=4 on 15f4019 (RTX 2070 SUPER): 1276 passed, 0 failed, 46 ignored, 25 SKIPPED. New smoke block in the description.

As you said, the retail smoke run makes no mirrors, so it does not reach these counters (this is under Not tested). I did not measure the off path separately.

(Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ivall/xcl:comment:7176130401 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2416#issuecomment-7176130401). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-25T22:15:17Z. --- Thanks, agreed: `XCL_ACTIVITY` only gated the logging thread. Fixed in 15f4019 (squashed into the PR's commit): - `host_main` calls `list_x::enable_sync_activity()` before it starts the activity thread. Until then `sync_title_buffers`, `sync_readable()` and `sync_count()` check one relaxed `AtomicBool` and go straight to the untimed path: no `Instant::now()`, no shared atomics. - New test `the_mirror_sync_counts_only_once_xcl_activity_enables_it`: with the counters off, `sync_readable()` / `sync_count()` leave every counter and the slowest time unchanged. After `enable_sync_activity()` they count. - `cargo test --workspace -- --test-threads=4` on 15f4019 (RTX 2070 SUPER): 1276 passed, 0 failed, 46 ignored, 25 SKIPPED. New smoke block in the description. As you said, the retail smoke run makes no mirrors, so it does not reach these counters (this is under **Not tested**). I did not measure the off path separately. (Claude Code, Claude Opus 5.5)
DavidM1911 commented 2026-11-26 03:06:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T02:22:14Z.


Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7180740156 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2416#issuecomment-7180740156). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T02:22:14Z. --- Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
luckyteagirl commented 2026-11-26 08:04:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T08:04:38Z.

Review: COMMENTED


At head fdbb6fe7ec0027a5b0274364475f0204684a8c5e, a mirror sync can cross the 2-second reporting boundary after a readable() call finishes but before the draw finishes. sync_readable publishes its count/time and updates SYNC_READABLE_MAX_NS during sync_mirrors, while SYNC_DRAWS is incremented only after sync_mirrors returns (list_x.rs:3774-3795). If the host samples in that gap, s[0] == 0, so host.rs:65-75 suppresses the row but still advances last_sync and resets the slowest value. The next row counts the completed draw without that readable work or its maximum. This can hide an isolated slow call, which this diagnostic is intended to show. Could the host emit a row whenever any mirror statistic is nonzero (including zero completed draws), or publish the per-draw values together after completion if rows must represent completed draws?

This is a source-derived diagnostics review, not a timed native reproduction. AI use: OpenAI Codex (GPT-6.2 Sol) traced the reporting path; I checked the exact-head counter and snapshot order before posting.

<!-- greyfinch-sync:ivall/xcl:review:6070417244 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2416#pullrequestreview-6070417244). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T08:04:38Z. **Review:** COMMENTED --- At head `fdbb6fe7ec0027a5b0274364475f0204684a8c5e`, a mirror sync can cross the 2-second reporting boundary after a `readable()` call finishes but before the draw finishes. `sync_readable` publishes its count/time and updates `SYNC_READABLE_MAX_NS` during `sync_mirrors`, while `SYNC_DRAWS` is incremented only after `sync_mirrors` returns (`list_x.rs:3774-3795`). If the host samples in that gap, `s[0] == 0`, so `host.rs:65-75` suppresses the row but still advances `last_sync` and resets the slowest value. The next row counts the completed draw without that readable work or its maximum. This can hide an isolated slow call, which this diagnostic is intended to show. Could the host emit a row whenever any mirror statistic is nonzero (including zero completed draws), or publish the per-draw values together after completion if rows must represent completed draws? This is a source-derived diagnostics review, not a timed native reproduction. AI use: OpenAI Codex (GPT-6.2 Sol) traced the reporting path; I checked the exact-head counter and snapshot order before posting.
KOLESNiii commented 2026-11-26 12:06:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-26T11:24:54Z.


Thanks, confirmed: with no draw's sync finished in a window, the row was skipped while take_sync_slowest() had already reset the slowest readable(), so a stalled sync lost exactly the number this is for.

Fixed in 49f0474 (amended into the commit) the first way you suggested: host.rs logs the row whenever any mirror counter or the slowest time moved (list_x::sync_row_due), including with 0 draws synced, which then reads as a sync still running at the sample or stalled. I kept the counters published as they happen rather than at the end of the draw, so a sync that never returns still shows up. New test: a_mirror_sync_row_with_no_finished_draw_is_still_logged. The full suite and the smoke run were redone on 49f0474 (counts and block in the description).

AI use: Claude Code (Claude Opus 5.5) checked the review against the code, wrote the fix and ran the tests; I reviewed it.

<!-- greyfinch-sync:ivall/xcl:comment:7190694899 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2416#issuecomment-7190694899). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-26T11:24:54Z. --- Thanks, confirmed: with no draw's sync finished in a window, the row was skipped while `take_sync_slowest()` had already reset the slowest `readable()`, so a stalled sync lost exactly the number this is for. Fixed in 49f0474 (amended into the commit) the first way you suggested: `host.rs` logs the row whenever any mirror counter or the slowest time moved (`list_x::sync_row_due`), including with 0 draws synced, which then reads as a sync still running at the sample or stalled. I kept the counters published as they happen rather than at the end of the draw, so a sync that never returns still shows up. New test: `a_mirror_sync_row_with_no_finished_draw_is_still_logged`. The full suite and the smoke run were redone on 49f0474 (counts and block in the description). AI use: Claude Code (Claude Opus 5.5) checked the review against the code, wrote the fix and ran the tests; I reviewed it.
Foniass commented 2026-12-01 08:00:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:00:05Z.


Triage (#1607) – head c6562a0

#2437 and #2533 are stacked on this PR: both contain this commit (c6562a0) and add their own changes to the mirror sync on top. That makes this the base of the stack, not a duplicate. Main has none of these counters (sync_title_buffers is unchanged there). Without XCL_ACTIVITY the sync only does one extra relaxed load per draw. No problems found in the diff. It conflicts with main's list_x.rs and needs a rebase.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7304746605 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2416#issuecomment-7304746605). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:00:05Z. --- **Triage (#1607)** – head c6562a0 #2437 and #2533 are stacked on this PR: both contain this commit (c6562a0) and add their own changes to the mirror sync on top. That makes this the base of the stack, not a duplicate. Main has none of these counters (`sync_title_buffers` is unchanged there). Without `XCL_ACTIVITY` the sync only does one extra relaxed load per draw. No problems found in the diff. It conflicts with main's list_x.rs and needs a rebase. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
KOLESNiii commented 2026-12-02 14:14:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-12-02T14:14:59Z.


Thanks for the triage. Rebased onto main df0cfef6: the list_x.rs conflict was main's new resolve_query_data_x_notes_exact_result_bytes_for_all_query_types test next to this PR's two tests, and I kept both. New head ccc2763b. The suite and the smoke run are queued again on it; the description will get the new counts and blocks once they are in.

— Claude Code (Claude Opus 5.5), on behalf of the PR author

<!-- greyfinch-sync:ivall/xcl:comment:7348231369 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2416#issuecomment-7348231369). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-12-02T14:14:59Z. --- Thanks for the triage. Rebased onto `main` df0cfef6: the `list_x.rs` conflict was `main`'s new `resolve_query_data_x_notes_exact_result_bytes_for_all_query_types` test next to this PR's two tests, and I kept both. New head `ccc2763b`. The suite and the smoke run are queued again on it; the description will get the new counts and blocks once they are in. — Claude Code (Claude Opus 5.5), on behalf of the PR author
Foniass commented 2026-12-02 14:18:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T14:18:40Z.


Follow-up review (head ccc2763b, since c6562a0, diff read, not a merge-check; checks red):

  • Earlier points: unchanged. The own commits are identical to the previous head (git range-diff / patch-id); this push only rebases onto the current main.

New: none.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7348332198 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2416#issuecomment-7348332198). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T14:18:40Z. --- Follow-up review (head ccc2763b, since c6562a0, diff read, not a merge-check; checks red): - **Earlier points:** unchanged. The own commits are identical to the previous head (`git range-diff` / patch-id); this push only rebases onto the current `main`. New: none. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2416:upstream-pr/2416'
git switch 'upstream-pr/2416'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/2416'
git switch 'upstream-pr/2416'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2416'
git switch 'upstream-pr/2416'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2416'
git switch 'main'
git merge --squash 'upstream-pr/2416'
git switch 'main'
git merge --ff-only 'upstream-pr/2416'
git switch 'main'
git merge 'upstream-pr/2416'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2406
No description provided.