Skip to content

feat(xtask): #1037 ci reports the machine, GPU adapters and skipped tests - #1135

Merged
echelon merged 3 commits into
storytold:mainfrom
THEtheChad:feat/ci-hardware-report
Oct 15, 2026
Merged

echelon merged 3 commits into
storytold:mainfrom
THEtheChad:feat/ci-hardware-report

Conversation

@THEtheChad

Copy link
Copy Markdown
Contributor

Refs #1037

What and why

Contributors and agents run cargo xtask ci before every commit on very different machines, but a green run says nothing about what it actually tested: libtest has no "skipped" status and hides the output of passing tests, so the CPU/GPU equivalence tests, the raw corpus tests and the CJK font tests pass silently when the GPU, corpus or fonts are missing. This PR makes cargo xtask ci report what the machine offered and which tests skipped, and writes a small report a contributor can paste into a PR. Test tooling only: no change to the pipeline, the GPU adapter policy or hosted CI.

  1. lightcraft-testkit (crates/testkit, the testkit slot xtask/src/layers.rs already reserves; dev-dependency only, std only). lightcraft_testkit::skip!(Gpu, "no GPU adapter ({why})") prints the note as before and, when LIGHTCRAFT_SKIP_LOG names a file, appends one JSON line (need, reason, test name, test binary, file:line). Plain cargo test is unchanged. The 61 existing eprintln! skip sites use it (GPU, corpus, craft-fonts, YuNet/SAM 3 models, LC_PREVIEW_RAW, system ICC profiles).
  2. Capability probe in xtask ci: OS and version, arch, CPUs, RAM, toolchain, git commit and dirty flag, pinned corpus samples present, CRAFT_FONTS_DIR. The GPU part comes from an ignored gpu_probe integration test in crates/gpu, run right after the workspace test step with --workspace, so it reuses that build (1.2 s here) and xtask stays std + serde_json, without wgpu. It reports the device the pipeline picks or why not, and every adapter per backend (software ones too), one backend per process so a driver that crashes while it is enumerated (v0.2.0 crashes at startup on Intel UHD 630 (access violation in igvk64.dll, Vulkan driver) #136) costs only its own entry. By default it probes only the backends the app itself loads.
  3. Report: target/ci/report.json (schema 1: commit, dirty flag, machine, capabilities, each step's result and time, skips) and a summary printed after CI summary, with the skips grouped by need and reason. The report holds no host name, user name or absolute path; nothing is uploaded.
  4. target/ci/summary.md (also printed with --summary-md): a Markdown block for a PR description, like the one below.
  5. Opt-in --hardware: after the workspace tests, runs cargo test -p lightcraft-gpu --features denoise once per backend with a hardware adapter, through the existing LIGHTCRAFT_GPU_BACKEND override.
  6. Docs: a short note in AGENTS.md / CLAUDE.md (Testing & performance), README (testing) and docs/architecture.md (quality gates, revision history).

This machine's report

cargo xtask ci --summary-md: pass at 76b5377 (with uncommitted changes)

Machine linux x86_64 (Ubuntu 24.04.4 LTS, kernel 6.18.33.2-microsoft-standard-WSL2), 16 CPUs, 14 GB RAM (9.3 GB available)
Rust rustc 1.99.0 (b940084d7 2026-09-28)
GPU for the pipeline none (software adapter (llvmpipe (LLVM 20.1.2, 256 bits)) skipped: the CPU pipeline is faster)
Adapters vulkan: llvmpipe (LLVM 20.1.2, 256 bits) (Cpu; llvmpipe Mesa 25.2.8-0ubuntu0.24.04.2 (LLVM 20.1.2))
Data corpus: 0 of 111 pinned raws, 0 images, 0 PngSuite files; no CRAFT_FONTS_DIR
Step Result Time
fmt ok 3.0 s
clippy ok 23.0 s
heif ok 40.4 s
test ok 4m 27s
parity ok 44.7 s
layers ok 0.0 s
assets ok 0.0 s
wasm ok 33.8 s
179 tests skipped (corpus 130, gpu 24, fonts 16, model 8, system 1)
Need Tests Reason For example
corpus 7 corpus/raw absent corpus::corpus_dngs_carry_profile_looks
corpus 3 corpus/raw/arw-sony-a7rm2-12bit-uncompressed.arw absent lightcraft_engine::camera_preview::tests::corpus_arw_with_a_lens_corrected_preview_gets_a_camera_look
corpus 3 cr2-canon-5d3.cr2 absent lightcraft_engine::camera_preview::tests::corpus_colour_precedence
corpus 3 cr2-canon-7d.cr2 absent lightcraft_engine::camera_preview::tests::corpus_colour_precedence
corpus 2 arw-sony-a500.arw absent corpus::corpus_sony_black_levels_sit_at_the_data_floor
corpus 2 arw-sony-a700.arw absent corpus::corpus_sony_black_levels_sit_at_the_data_floor
corpus 2 arw-sony-a7cm2-compressed-m.arw absent corpus::corpus_sony_a7cm2_codings
corpus 2 arw-sony-a7cm2-lossless-l.arw absent corpus::corpus_sony_a7cm2_codings
corpus 2 arw-sony-a7cr-compressed.arw absent lightcraft_engine::camera_preview::tests::corpus_a7cr_codings_get_a_camera_look
corpus 2 arw-sony-a7cr-lossless-l.arw absent lightcraft_engine::camera_preview::tests::corpus_a7cr_codings_get_a_camera_look
corpus 2 arw-sony-a7cr-lossless-m.arw absent lightcraft_engine::camera_preview::tests::corpus_a7cr_codings_get_a_camera_look
corpus 2 arw-sony-a900-packed12.arw absent corpus::corpus_sony_a900_packed12
corpus 98 85 other reasons
gpu 17 no GPU adapter equivalence::a_window_does_not_keep_the_whole_source_on_the_device
gpu 4 no GPU runner here (software adapter (llvmpipe (LLVM 20.1.2, 256 bits)) skipped: the CPU is faster) lightcraft_gpu::nn::tests::a_runner_serves_many_tiles_from_many_threads
gpu 2 no GPU adapter (software adapter (llvmpipe (LLVM 20.1.2, 256 bits)) skipped: the CPU pipeline is faster) lightcraft_engine::export::tests::a_batch_reports_a_gpu_fallback_on_the_file_it_hit
gpu 1 no GPU adapter (software adapter (llvmpipe (LLVM 20.1.2, 256 bits)) skipped: the CPU pipeline is faster), so only the CPU side is checked shutdown::nothing_renders_on_the_gpu_once_the_process_is_ending
fonts 2 ja: built without a craft-fonts face for Jpan lightcraft_ui_egui::i18n::tests::catalog_characters_are_paintable
fonts 2 zh-hans: built without a craft-fonts face for Hans lightcraft_ui_egui::i18n::tests::catalog_characters_are_paintable
fonts 2 zh-hant: built without a craft-fonts face for Hant lightcraft_ui_egui::i18n::tests::catalog_characters_are_paintable
fonts 1 Japanese comparisons: built without BIZ UDMincho from craft-fonts lightcraft_engine::export::tests::vertical_watermarks_keep_combining_marks_in_one_cell
fonts 1 built without BIZ UDMincho from craft-fonts lightcraft_engine::export::tests::biz_ud_vertical_watermarks_place_punctuation_at_the_top_right
fonts 1 built without CRAFT_FONTS_DIR, so there is no Japanese watermark face lightcraft_engine::export::tests::japanese_watermarks_support_vertical_columns
fonts 1 de: built without a craft-fonts face for Latn lightcraft_ui_egui::i18n::tests::catalog_characters_are_paintable
fonts 1 es: built without a craft-fonts face for Latn lightcraft_ui_egui::i18n::tests::catalog_characters_are_paintable
fonts 1 fr: built without a craft-fonts face for Latn lightcraft_ui_egui::i18n::tests::catalog_characters_are_paintable
fonts 1 no Thai face in craft-fonts lightcraft_ui_egui::theme::tests::thai_face_is_a_fallback_in_every_ui_family_when_craft_fonts_carry_one
fonts 1 pt-br: built without a craft-fonts face for Latn lightcraft_ui_egui::i18n::tests::catalog_characters_are_paintable
fonts 1 ru: built without a craft-fonts face for Cyrl lightcraft_ui_egui::i18n::tests::catalog_characters_are_paintable
fonts 1 1 other reasons
model 4 LC_YUNET_MODEL is not set lightcraft_engine::tests_face_models::detect_replaces_only_earlier_detections_and_is_one_undo_step
model 3 LC_YUNET_MODEL is not set, so the face-finding part is not checked lightcraft_engine::cmd::face_recognize::imp::tests::only_the_background_scan_looks_for_faces_and_only_in_photos_without_any
model 1 set LIGHTCRAFT_SAM3_DIR and LIGHTCRAFT_SAM3_REF reference::matches_reference
system 1 no system ICC profiles corpus::system_icc_profiles

(The "uncommitted changes" are the one-line clippy fix from #997, see below; the committed tree is otherwise identical.)

Test plan

  • lightcraft-testkit unit tests: JSON line format and escaping, cargo's binary hash stripped, eight threads appending at once give eight whole lines, an unwritable log never fails a test.
  • xtask unit tests: skip logs read per step, deduplicated across the HEIF and workspace runs, cut free of the workspace root; prepare clears only the previous run's files; the probe asks only the pipeline's backends by default and every compiled backend with --hardware, and a crashing backend is recorded as an error; text and Markdown summaries (pipe escaping, durations); "no skips" is not claimed when the test step never ran.
  • cargo xtask layers: testkit is a dev-dependency everywhere.
  • Full cargo xtask ci (rustc 1.99.0, WSL2): green; the summary above lists 179 skips.

Notes

  • Pre-existing clippy failure on rustc 1.99: crates/pipeline/src/spots.rs:250 (chunks_exact_to_as_chunks) fails clippy -D warnings on origin/main. Issue #989: clippy 1.99, fill_box reads its buffer with as_chunks::<3>() (item 4) #997 fixes it; I applied that one-line fix locally, uncommitted, to get the rest of ci to run. It is not part of this PR.
  • Overlap with Tests don't run in CI on macOS, Windows or Linux, and the CPU/GPU equivalence tests never run in CI (gap 9) #1050 (branch ci/platform-tests, a separate PR): it adds LIGHTCRAFT_GPU_ALLOW_SOFTWARE to ctx.rs and edits crates/gpu/tests/equivalence.rs. This PR only changes the skip line of that file's gpu() helper; the two branches merge cleanly (git merge-tree), and each applies on its own to origin/main. With both merged, the probe reports software adapters the opt-in would accept, and the equivalence skips disappear from the report on CI runners.
  • Left out on purpose: per-test failure records (xtask streams cargo's output rather than parsing it), any upload or automatic PR comment, and any change to which adapters the pipeline accepts. The issue describes a possible next step (aggregating reports into a per-commit hardware matrix) as a decision for the maintainers. These reports are self-reported evidence, not a merge gate; hosted CI stays the gate.

🤖 Generated with Claude Code

THEtheChad and others added 3 commits October 11, 2026 16:33
libtest has no skipped status and hides the output of passing tests, so a
test that returns early without a GPU, a corpus file, a craft-fonts face or
a model passed silently. `lightcraft-testkit` (the testkit slot the layering
table already reserves, dev-dependency only, std only) adds
`skip!(Need, "reason")`: it prints the note as before and, when
LIGHTCRAFT_SKIP_LOG names a file, appends one JSON line (need, reason, test,
binary, file:line). Plain `cargo test` is unchanged. The 61 existing skip
sites use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…skipped tests

`cargo xtask ci` points each test step at target/ci/skips-<step>.jsonl,
then probes the machine: OS, CPUs, RAM, toolchain, corpus and craft-fonts,
and the GPU through the ignored `gpu_probe` test of lightcraft-gpu (run
right after the workspace tests with --workspace, so it reuses their build;
xtask stays without wgpu). The run ends with the skips grouped by need and
reason and writes target/ci/report.json (schema 1: commit, dirty flag,
machine, capabilities, step results and times, skips) and
target/ci/summary.md for a PR (`--summary-md` prints it). `--hardware`
also runs the lightcraft-gpu tests once per backend that has a hardware
adapter. Nothing is uploaded; reasons are cut free of the workspace root
and home directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@echelon

echelon commented Oct 15, 2026

Copy link
Copy Markdown
Member

Thank you @THEtheChad! This landed on main in integration batch 37 (#1852), rebased onto main after the previous batches. Your ci options are kept beside #1053's removal of the Nikon download step.

If you haven't already, please join our Discord: https://discord.gg/artcraft. We'd love to have you there.

chrisgleissner pushed a commit to chrisgleissner/lightcraft that referenced this pull request Oct 15, 2026
# Conflicts:
#	xtask/src/main.rs
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