Scripts: generate flamegraphs for Criterion benchmarks #1144
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1153"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-24T12:35:04Z.
Adds a Windows flamegraph wrapper for the benchmark targets, stacked on #1152. It validates the selected target, forwards an optional Criterion filter, and writes SVG output under
target/flamegraphsby default.What is in it
scripts/flamegraph.ps1: validatedcargo-flamegraphwrapper and output handlingCargo.tomlandREADME.md: profiling configuration and usageTested
c09b78f:cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 741 passed, 0 failed, 41 ignored; skippedgpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64)cargo bench -p xcl --benches -- --test: all four targets built and all 68 benchmarks succeededRegression run
test-onlyapproval on this revision. No paired retail smoke results are available.Not tested
scripts/flamegraph.ps1end to end (requirescargo-flamegraphand an elevated shell), AMD, release, or a retail title; no benchmark timings were takenAI use
OpenAI Codex with GPT-5 wrote the implementation. Claude Code with Claude Opus 5.5 ran the external validation and wrote the test report; the contributor checked it before posting.
OpenAI Codex (GPT-6.2 Astra) checked the changed files and CI logs and revised the title and regression-run explanation.
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:30:13Z.
Full-suite run, since this PR has no test report yet. Tested exact head
c09b78f(on its base47efa2e).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 741 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.cargo bench -p xcl --benches -- --test(each benchmark run once): all four bench targets (core,formats,gpu_cpu,runtime) build in the bench profile, and all 68 benchmarks reportSuccess. No timings taken.Not tested
scripts/flamegraph.ps1(needscargo-flamegraphand an elevated shell), AMD, a release build, a game (test run only).AI use
upstream-sync referenced this pull request2026-11-24 23:06:49 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T08:02:12Z.
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!
[PR #1153] Perf/benchmark flamegraphsto [PR #1153] Scripts: generate flamegraphs for Criterion benchmarksImported from ivall/xcl. Originally posted by ivall on 2026-11-25T13:51:49Z.
Review of head
c09b78f(stacked on #1152 and #1148). I read the whole diff before building. The new parts beyond the benchmarks arescripts/flamegraph.ps1and a[profile.bench] debug = 1in the root Cargo.toml. The script runscargo flamegraph --package xcl --bench <one of four validated names> --output <path> -- [filter] --bench; the bench name comes from a ValidateSet, arguments are passed as an array (no string evaluation), it installs nothing and does not elevate (it only checks). No network, no build.rs, no workflow changes, no binaries. The script itself has not been run end to end (needs cargo-flamegraph and an elevated shell; I did not run it) and has no test.Tested on this tree (#1148 + #1152 + #1153 merged onto current main): AMD RDNA4, Windows, DXC 1.8.2502.11, debug.
cargo build --workspace: okcargo test --workspace --no-fail-fast -- --test-threads=4: 1263 passed, 2 failed, 46 ignored; the two failures are the knownfuzz_validate_and_gpu_1and_3(#2115), also failing on main. The kernelx tests that failed once in #1152's CI passed here.cargo bench -p xcl --bench core|formats|gpu_cpu|runtime -- --test: 2 + 19 + 18 + 29 = 68 benchmarks succeeded. No timings taken.Dependencies: criterion 0.7 is dev-only, no existing crate bumped, but its transitive
ciborium,ciborium-io,ciborium-llare Apache-2.0 only, which CONTRIBUTING.md excludes. cargo-flamegraph is an external tool, not a dependency. Not merging until the licence question in #1148 is decided; leaving this PR open.AI use: Claude Code (Claude Sonnet 5.5) read the diff, ran the tests and wrote this on the maintainer's behalf.
Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-26T00:06:29Z.
I tested the Windows preflight on
c09b78fe74856039e15bcbaf99993a2ba091e1f7from an ordinary (non-administrator) account. With PATH limited to temporary native stand-ins, the real wrapper rejected an invalid benchmark name, a valid benchmark with no profiler installed, and a valid benchmark with the profiler visible but no administrator rights. In each case the diagnostic identified the corresponding cause, the caller remained in the original directory, no command stand-in ran, and no SVG appeared.Test-only fixture. I ran
-NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts/flamegraph-preflight.tests.ps1under Windows PowerShell 5.1 and PowerShell 7.6.9; all three cases passed in each shell. Windows 11, Core i7-13700. No elevated profiling session, benchmark build, or flamegraph generation was run. OpenAI Codex (GPT-6) wrote the fixture and ran it.Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:44:54Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:37:54Z.
Review of
c09b78fe(code reading only, not a merge-check; it conflicts with main, so not built or run; stacked on #1152 / #1148) · 3 mediumIn short: Adds
scripts/flamegraph.ps1, which runs a bench target under cargo-flamegraph. The script itself should work with main's harness. To land it: rebase with only the flamegraph commit, drop[profile.bench], rewrite the README lines for the in-tree harness, and run the script end to end once.Medium
f73d165eandf84d8501landed asc35d24a8and1120fdc9via #2959, so a rebase should keep onlyc09b78fe(about 90 lines). No other PR does flamegraphs.[profile.bench] debug = 1isn't needed. In the rootCargo.tomlit lowers the symbols: the bench profile already inherits[profile.release] debug = 2. Drop it.target/criterionand--save-baseline, which main's in-tree harness doesn't have; it also says twice that the wrapper never requests elevation. Rewrite those lines for the in-tree harness, and drop "Criterion" from the title.Checked and fine
scripts/flamegraph.ps1should work with main's harness (it ignores--benchand takes the first plain argument as a substring filter,benches/support/mod.rs~244-256).ValidateSetmatch main's four targets.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.