Skip to content

Commit 3933be5

Browse files
committed
fix(ci): build the dump path by joining, and publish around a failed kernel
The autovec tests pasted a forward slash onto the result of `canonicalize`, which on Windows is a verbatim `\\?\C:\...` path. A verbatim path takes no forward slash as a separator, so the name was rejected outright and all three tests failed on the msvc target. They never ran before now: the target failed to build, so this surfaced only once that was fixed. A failed kernel also took the whole site down with it. `benchmark- aggregate` depended on `benchmark` without `always()`, so any matrix leg failing skipped aggregation, which skipped the deploy. One crashing kernel therefore blanked every other kernel's published numbers rather than just its own row. Aggregation now runs on whatever legs produced results, and still fails loudly if no x86_64 partial exists at all.
1 parent 2f59292 commit 3933be5

2 files changed

Lines changed: 26 additions & 12 deletions

File tree

‎.github/workflows/wiki.yml‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ jobs:
195195
benchmark-aggregate:
196196
name: Aggregate benchmark results
197197
needs: benchmark
198+
# `needs` alone would skip this whenever any matrix leg failed, and a
199+
# skipped aggregate skips the deploy, so one crashing kernel takes the
200+
# whole published page down with it rather than just its own row. Run
201+
# on the legs that did produce results; a kernel that failed simply has
202+
# no partial to merge and does not appear.
203+
if: ${{ always() && needs.benchmark.result != 'cancelled' }}
198204
runs-on: ubuntu-latest
199205
steps:
200206
- name: Download x86_64 per-kernel results
@@ -224,10 +230,15 @@ jobs:
224230
# report both. The page loads each file and labels the switch
225231
# from its own `meta.cpu`.
226232
run: |
227-
ls -la bench-parts/
228233
mkdir -p bench-out
229-
jq -s 'reduce .[] as $x ({}; . * $x)' bench-parts/*.json > bench-out/results.json
230-
cat bench-out/results.json | jq 'keys'
234+
ls -la bench-parts/ || true
235+
if compgen -G 'bench-parts/*.json' > /dev/null; then
236+
jq -s 'reduce .[] as $x ({}; . * $x)' bench-parts/*.json > bench-out/results.json
237+
cat bench-out/results.json | jq 'keys'
238+
else
239+
echo "::error::no x86_64 partials produced; nothing to publish"
240+
exit 1
241+
fi
231242
# macOS runners are best-effort: a failed or skipped leg leaves
232243
# no partials, and the page renders the x86_64 set alone.
233244
if compgen -G 'bench-parts-macos/*.json' > /dev/null; then
@@ -246,6 +257,7 @@ jobs:
246257

247258
deploy-site:
248259
needs: benchmark-aggregate
260+
if: ${{ always() && needs.benchmark-aggregate.result == 'success' }}
249261
runs-on: ubuntu-latest
250262
environment:
251263
name: github-pages

‎crates/zynml/tests/autovec.rs‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ static DUMPING: Mutex<()> = Mutex::new(());
1818

1919
fn build(src: &str, dump: &str) -> (f64, usize) {
2020
let _serialised = DUMPING.lock().unwrap_or_else(|e| e.into_inner());
21-
let dir = format!(
22-
"{}/target/hirdump_{dump}",
23-
Path::new(env!("CARGO_MANIFEST_DIR"))
24-
.join("../..")
25-
.canonicalize()
26-
.unwrap()
27-
.display()
28-
);
21+
// Built by joining rather than formatting: `canonicalize` returns a
22+
// verbatim `\\?\C:\...` path on Windows, which takes no forward
23+
// slash as a separator, so pasting one in makes the name invalid.
24+
let dir = Path::new(env!("CARGO_MANIFEST_DIR"))
25+
.join("../..")
26+
.canonicalize()
27+
.unwrap()
28+
.join("target")
29+
.join(format!("hirdump_{dump}"));
2930
std::fs::remove_dir_all(&dir).ok();
3031
std::fs::create_dir_all(&dir).unwrap();
3132
// Process-global, and these tests share a process, so each one
@@ -53,7 +54,8 @@ fn build(src: &str, dump: &str) -> (f64, usize) {
5354
.collect();
5455
assert!(
5556
!hir.is_empty(),
56-
"no HIR dump at {dir}; the vector-op count below would be meaningless"
57+
"no HIR dump at {}; the vector-op count below would be meaningless",
58+
dir.display()
5759
);
5860
let vector_ops = hir.matches("vload").count() + hir.matches("vstore").count();
5961
(value, vector_ops)

0 commit comments

Comments
 (0)