Skip to content

Stream verifier scheduler output, quiet VMM diagnostics, fix summary glyph - #26

Merged
likewhatevs merged 4 commits into
mainfrom
verifier-output-streaming
Jul 10, 2026
Merged

Stream verifier scheduler output, quiet VMM diagnostics, fix summary glyph#26
likewhatevs merged 4 commits into
mainfrom
verifier-output-streaming

Conversation

@likewhatevs

Copy link
Copy Markdown
Owner

Fixes three CI-log ergonomics problems surfaced by the scx verifier runs (sched-ext/scx#3700):

Scheduler stdout/stderr now reach the test's stdout/stderr — including on timeout

The scheduler's output was captured into a merged /tmp/sched.log in the guest and shipped only by the teardown dump, which a watchdog kill never reaches — a hung cell reported only scheduler: UNKNOWN — VM timed out before exit with no scheduler output at all. Even on dumping runs, the formatter printed only the extracted libbpf verifier-log region (dropping the scheduler's own messages) and stderr never reached the test's stderr.

Now the scheduler child's stdout/stderr are piped through per-stream forwarder threads that tee into the merged log file (all existing dump paths intact) and stream live over new SCHED_STDOUT/SCHED_STDERR bulk frames. Whatever arrived before a watchdog kill still renders. Stdout renders in full with the verifier trace collapsed in place; stderr is emitted to the test's real stderr. The dump paths wait (bounded) for the forwarders to drain so the merged file stays as complete as when the child wrote it directly.

VMM diagnostics gated behind debug logging

The per-vCPU no_perf_mode mask lines, BSP: run-loop trace, and CLEANUP: teardown timings buried scheduler failures in CI logs. They now print only when KTSTR_DEBUG=1 or RUNNER_DEBUG=1 (the variable GitHub Actions exports on "re-run with debug logging"). Warnings, watchdog-deadline diagnostics, and VM-setup timings stay unconditional.

Verifier summary glyph

The mixed-cell 🇽 (a lone regional-indicator codepoint) renders as a boxed/blue X or tofu depending on the font stack and misaligns the grid; it's now ❎, same width as ✅/❌.

Test plan

  • cargo nextest run --no-fail-fast — 10382 passed, 0 failed (includes the VM-booting verifier_pipeline cells; the previously-flaky verifier_cycle_collapse passed 8/8 consecutive isolated runs after the forwarder-drain fix)
  • just lint — all legs green (fmt, clippy, clippy wprof,integration, doc-strict, docsrs-mode)
  • just test-doc, just test-macros — green
  • End-to-end against the scx PR use case: built scx_cosmos from add tests against distro kernels sched-ext/scx#3700 with ktstr path-patched, ran cargo ktstr verifier --scheduler cosmos --kernel ubuntu; failed cells now show the scheduler's real error (Error: Failed to load BPF program — Invalid argument) on stdout, scheduler stderr in the stderr section, no duplicated sections, and none of the gated diagnostic noise

A failed scheduler cell in CI buried its actual failure under
hundreds of host-side diagnostic lines: one no_perf_mode affinity
line per vCPU, the BSP run-loop trace, and the CLEANUP teardown
timings. None of them help someone debugging their scheduler — they
exist for debugging ktstr itself.

Route them through debug_logging_enabled(), on when KTSTR_DEBUG=1 or
RUNNER_DEBUG=1 — the latter is what GitHub Actions exports on
"re-run with debug logging", so a failed CI job re-run in debug
mode gets the full diagnostics without a ktstr-specific knob.
Warnings, watchdog-deadline diagnostics, VM-setup timings, and the
interactive shell's abnormal-exit line stay unconditional.
U+1F1FD REGIONAL INDICATOR SYMBOL LETTER X is half of a flag pair,
not a standalone emoji: alone it renders as a boxed X, a blue X, or
tofu depending on the font stack, and its ambiguous width misaligns
the summary-grid columns. ❎ (U+274E) is a standard emoji with the
same width as ✅/❌, so the mixed cell renders everywhere the other
two states already do.
A verifier cell that hung after attach reported only "scheduler:
UNKNOWN — VM timed out before exit": the scheduler's output was
captured into a merged /tmp/sched.log inside the guest and shipped
to the host only by the teardown dump, which a watchdog kill never
reaches. Even on runs that did dump, the formatter printed only the
libbpf verifier-log region extracted from the blob — dropping the
scheduler's own messages around it — and stderr was merged
indistinguishably into stdout, never reaching the test's stderr.

Wire the scheduler child's stdout and stderr through per-stream
forwarder threads that tee each pipe read into the merged log file
(keeping every existing dump path intact) and ship it immediately as
new SCHED_STDOUT / SCHED_STDERR bulk frames. The host records both
streams unconditionally, so whatever arrived before a watchdog kill
still renders. The stdout section now shows the full scheduler
stdout with the verifier trace collapsed in place instead of
extract-and-drop, and the captured stderr is emitted to the test's
real stderr (skipping the merged-dump fallback when a live stream
arrived, so the two sections never duplicate). The dump paths wait
(bounded) for the forwarders to drain the dead child's pipes so the
merged file stays as complete as when the child wrote it directly.
New minor: verifier cells stream the scheduler's stdout/stderr live
from the guest — output survives watchdog timeouts, stdout renders
in full with the verifier trace collapsed in place, and stderr
reaches the test's stderr; noisy host-side VMM diagnostics
(no_perf_mode masks, BSP run-loop trace, CLEANUP timings) are gated
behind KTSTR_DEBUG=1 / RUNNER_DEBUG=1; the mixed verifier-summary
cell renders ❎ instead of the font-dependent 🇽.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.49451% with 71 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/vmm/rust_init/scheduler.rs 67.10% 25 Missing ⚠️
src/vmm/freeze_coord/mod.rs 58.33% 20 Missing ⚠️
src/verifier.rs 91.95% 16 Missing ⚠️
src/test_support/dispatch.rs 0.00% 4 Missing ⚠️
src/vmm/guest_comms.rs 50.00% 3 Missing ⚠️
src/vmm/rust_init/dump.rs 0.00% 1 Missing ⚠️
src/vmm/rust_init/modes.rs 90.00% 1 Missing ⚠️
src/vmm/vcpu.rs 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@likewhatevs
likewhatevs merged commit 4b23699 into main Jul 10, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants