Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
53a854d
ci: regenerate.yml, the write recipes on runners (SPEC.md §9.4)
humuhumu33 Nov 11, 2026
a66bd0c
ci: regenerate.yml starts on a push to regenerate/**
humuhumu33 Nov 11, 2026
79ec164
conformance: the BS evaluator differential runs on every processor
humuhumu33 Nov 11, 2026
e91a164
Merge release/v0.4 (7eb816284, rustix 1.1.6 for RUSTSEC-2026-0486)
humuhumu33 Nov 11, 2026
9bb732e
Merge release/v0.4 (7eb816284, rustix 1.1.6 for RUSTSEC-2026-0486)
humuhumu33 Nov 11, 2026
f952ed5
ci: regenerate.yml also writes the counts, model documents and stack …
humuhumu33 Nov 11, 2026
3da2bd3
ci: export the bootstrap project once per run (SPEC.md §9.4)
humuhumu33 Nov 12, 2026
34aca62
ci: run the Windows host's tests as five lanes (SPEC.md §8.3)
humuhumu33 Nov 12, 2026
2636707
ci: drop the Python bytecode committed with the Windows lanes
humuhumu33 Nov 12, 2026
68af105
ci: fail stale generated files in honesty (`cargo xtask check-freshne…
humuhumu33 Nov 12, 2026
d59533c
ci: drop the five duplicate keys of .github/bdd-parts.json
humuhumu33 Nov 12, 2026
834522b
Merge remote-tracking branch 'origin/release/v0.4' into ci/freshness-…
humuhumu33 Nov 12, 2026
8ab6fe6
Merge remote-tracking branch 'origin/release/v0.4' into ci/one-bootst…
humuhumu33 Nov 12, 2026
4a00a38
Merge remote-tracking branch 'origin/release/v0.4' into ci/windows-lanes
humuhumu33 Nov 12, 2026
0410787
Merge fix/bdd-parts-duplicates into the gate-speed integration
humuhumu33 Nov 12, 2026
09dedc2
Merge ci/parallel-evaluator into the gate-speed integration
humuhumu33 Nov 12, 2026
dc4434e
Merge ci/regenerate-workflow into the gate-speed integration
humuhumu33 Nov 12, 2026
6f183f5
Merge ci/freshness-check into the gate-speed integration
humuhumu33 Nov 12, 2026
125d032
Merge ci/one-bootstrap-export into the gate-speed integration
humuhumu33 Nov 12, 2026
f3b25f2
Merge ci/windows-lanes into the gate-speed integration
humuhumu33 Nov 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .github/bdd-parts.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,21 +261,6 @@
"VR-22",
"VR-23"
],
"preservation-lists": [
"SP-15"
],
"preservation-runtime": [
"SP-22"
],
"preservation-support": [
"SP-25"
],
"bootstrap-runtime": [
"BS-09"
],
"preservation-prims": [
"SP-28"
],
"preservation-std": [
"SP-29",
"SP-32",
Expand Down
199 changes: 199 additions & 0 deletions .github/scripts/host_lanes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
#!/usr/bin/env python3
"""Run one supported host's tests as lanes of one run, and join them (SPEC §8.3/§9.4).

A host whose one `cargo test --workspace` was the longest job of the gate runs
it as lanes instead, each a job of its own clean checkout and build: the
conformance harness's cases, partitioned exactly as the Intel lanes partition
them (`.github/intel-host-lanes.json`, whose completeness honesty checks), and
the `producer` lane, every other test of the workspace and every doctest. Each
lane records what the host listed and what it executed; the join requires a
receipt from every lane of the same run and commit, lanes that are disjoint,
and an execution whose union is the host's whole listing, test for test,
before the host's context passes. Nothing crosses runs. Python 3.9+.
"""

import argparse
from collections import Counter
import json
import os
from pathlib import Path
import re
import subprocess
import sys

sys.path.insert(0, str(Path(__file__).resolve().parent))
import intel_host_tests as factory # noqa: E402 (the shared partition)

SCHEMA = 1
PRODUCER = "producer"
CARGO = ["cargo", "test", "--locked", "--all-features", "--no-fail-fast"]
HARNESS = [*CARGO, "-p", "repo-conformance", "--test", "conformance"]
RESULT = re.compile(r"test (.+?) \.\.\. (ok|ignored|FAILED)(?:, .*)?")
SUFFIXES = (" - should panic", " - compile fail", " - no_run")

require = factory.require
Invalid = factory.Invalid


def lanes(root):
"""The lanes of a host: the producer, then the conformance lanes."""
bdd, plan = factory.plan(root)
return bdd, plan, [PRODUCER, *plan["lanes"]]


def listing(output):
"""Every `name: test` line of a (multi-binary) `--list` transcript."""
return [line[: -len(": test")] for line in output.splitlines() if line.endswith(": test")]


def executed(output):
names = []
for line in output.splitlines():
match = RESULT.fullmatch(line.strip())
if match:
name = match.group(1)
for suffix in SUFFIXES:
name = name.removesuffix(suffix)
names.append(name)
return names


def run(command, root, capture=True):
print("+ " + " ".join(command), flush=True)
process = subprocess.Popen(command, cwd=root, stdout=subprocess.PIPE, text=True,
encoding="utf-8", errors="replace")
lines = []
for line in process.stdout:
sys.stdout.write(line)
lines.append(line)
sys.stdout.flush()
return process.wait(), "".join(lines)


def metadata_targets(root):
"""The test-carrying targets of repo-conformance other than the harness."""
output = subprocess.run(["cargo", "metadata", "--locked", "--format-version", "1", "--no-deps"],
cwd=root, check=True, stdout=subprocess.PIPE, text=True).stdout
package = next(p for p in json.loads(output)["packages"] if p["name"] == "repo-conformance")
selectors = []
for target in package["targets"]:
kinds = set(target["kind"])
if "test" in kinds and target["name"] != "conformance":
selectors += ["--test", target["name"]]
elif kinds & {"lib", "rlib"}:
selectors.append("--lib")
elif "bin" in kinds:
selectors += ["--bin", target["name"]]
return selectors


def identity(root):
git = lambda *args: subprocess.run(["git", *args], cwd=root, check=True, # noqa: E731
stdout=subprocess.PIPE, text=True).stdout.strip()
return {"commit": git("rev-parse", "HEAD"), "tree": git("rev-parse", "HEAD^{tree}"),
"run": os.environ.get("GITHUB_RUN_ID", ""), "attempt": os.environ.get("GITHUB_RUN_ATTEMPT", "")}


def execute(root, target, lane, output):
host = subprocess.run(["rustc", "-vV"], cwd=root, check=True, stdout=subprocess.PIPE,
text=True).stdout
require(f"host: {target}\n" in host, f"this runner is not {target}")
bdd, plan, names = lanes(root)
require(lane in names, f"`{lane}` is no lane of {factory.LANES}")
status, out = run([*HARNESS, "--", "--list"], root)
require(status == 0, "the conformance harness does not list")
conformance = factory.parse_list(out)
receipt = {"schema": SCHEMA, "target": target, "lane": lane, **identity(root),
"conformance": conformance, "whole": None, "executed": []}
failed = False
if lane == PRODUCER:
status, out = run(["cargo", "test", "--locked", "--workspace", "--all-features", "--", "--list"], root)
require(status == 0, "the workspace does not list")
receipt["whole"] = sorted(listing(out))
commands = [
[*CARGO, "--workspace", "--exclude", "repo-conformance"],
[*CARGO, "-p", "repo-conformance", *metadata_targets(root)],
[*CARGO, "-p", "repo-conformance", "--doc"],
]
else:
commands = [[*HARNESS, "--", *factory.lane_filters(bdd, plan)[lane]]]
for command in commands:
status, out = run(command, root)
failed |= status != 0
receipt["executed"] += executed(out)
receipt["executed"].sort()
receipt["passed"] = not failed
output.mkdir(parents=True, exist_ok=True)
(output / "receipt.json").write_text(json.dumps(receipt, indent=1, sort_keys=True) + "\n")
require(not failed, f"lane `{lane}` has a failing test")
print(f"host-lanes: {target} lane {lane}: {len(receipt['executed'])} tests passed")


def join(root, target, artifacts):
bdd, plan, names = lanes(root)
receipts = {}
for path in sorted(Path(artifacts).glob("*/receipt.json")):
receipt = json.loads(path.read_text())
require(receipt.get("schema") == SCHEMA and receipt.get("target") == target,
f"{path}: a receipt of another host or format")
require(receipt["lane"] not in receipts, f"two receipts of lane `{receipt['lane']}`")
receipts[receipt["lane"]] = receipt
return check_join(receipts, names, plan, bdd, identity(root))


def check_join(receipts, names, plan, bdd, here):
"""The lanes are this run's and commit's, complete, disjoint, and passed."""
require(sorted(receipts) == sorted(names), f"lanes {sorted(names)}, receipts {sorted(receipts)}")
for lane, receipt in receipts.items():
for field in ("commit", "tree", "run", "attempt"):
if field == "attempt":
require(str(receipt[field]).isdigit() and int(receipt[field]) <= int(here[field] or 0),
f"lane `{lane}` ran in another attempt")
else:
require(receipt[field] == here[field], f"lane `{lane}` ran on another {field}")
require(receipt.get("passed") is True, f"lane `{lane}` did not pass")
conformance = receipts[PRODUCER]["conformance"]
require(conformance and all(r["conformance"] == conformance for r in receipts.values()),
"the lanes listed different conformance harnesses")
named = {factory.test_name(i) for ids in bdd["parts"].values() for i in ids}
require(named <= set(conformance), f"named tests absent: {sorted(named - set(conformance))}")
whole = Counter(receipts[PRODUCER]["whole"] or [])
ran = Counter(name for r in receipts.values() for name in r["executed"])
require(whole, "the producer listed no workspace")
missing, extra = whole - ran, ran - whole
require(not missing and not extra,
f"executed is not the host's listing: missing {sorted(missing)[:20]}, extra {sorted(extra)[:20]}")
for lane in names:
if lane == PRODUCER:
continue
require(set(receipts[lane]["executed"]) <= set(conformance),
f"lane `{lane}` ran a test outside the conformance harness")
print(f"host-lanes: {len(ran)} tests of {len(names)} lanes equal the host's listing, each once")
return sum(ran.values())


def main():
parser = argparse.ArgumentParser(description=__doc__)
sub = parser.add_subparsers(dest="command", required=True)
one = sub.add_parser("execute")
one.add_argument("--target", required=True)
one.add_argument("--lane", required=True)
one.add_argument("--output", required=True, type=Path)
both = sub.add_parser("join")
both.add_argument("--target", required=True)
both.add_argument("--artifacts", required=True)
arguments = parser.parse_args()
root = Path(__file__).resolve().parents[2]
try:
if arguments.command == "execute":
execute(root, arguments.target, arguments.lane, arguments.output)
else:
join(root, arguments.target, arguments.artifacts)
except Invalid as error:
print(f"::error::{error}", file=sys.stderr)
return 1
return 0


if __name__ == "__main__":
sys.exit(main())
51 changes: 51 additions & 0 deletions .github/scripts/take-bootstrap-export.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bash
# The fetcher of the run's bootstrap export (SPEC.md §9.4), started beside a
# leg's gate command in a run that is the whole gate. It waits until a case
# of the leg asks for the export (the harness writes `<dir>/wanted`), then
# waits for the artifact `bootstrap-export` of THIS run, unpacks it into
# `<dir>/artifact`, and writes `<dir>/ready`; the harness checks the custody
# record against its own run and checkout before any case reads the bundle.
# When the `bootstrap export` job ends without the artifact it writes the
# reason to `<dir>/failed`, and the case fails with it. It reads the run's
# artifacts and jobs through `gh` with the job's token (`actions: read`),
# and nothing of another run.
set -uo pipefail
dir=${1:?the directory the harness waits in}
repo=${GITHUB_REPOSITORY:?}
run=${GITHUB_RUN_ID:?}
mkdir -p "$dir"
fail() {
printf '%s\n' "$1" > "$dir/failed.tmp" && mv "$dir/failed.tmp" "$dir/failed"
echo "take-bootstrap-export: $1" >&2
exit 1
}
# No API call until a case needs the export: most legs never ask.
until [ -e "$dir/wanted" ]; do sleep 5; done
echo "take-bootstrap-export: wanted at $(date -u +%H:%M:%SZ)"
polls=0
while :; do
id=$(gh api "repos/$repo/actions/runs/$run/artifacts?name=bootstrap-export" \
--jq '[.artifacts[] | select(.expired | not)] | max_by(.created_at) | .id // empty' 2>/dev/null) || id=
if [ -n "$id" ]; then
rm -rf "$dir/artifact" "$dir/artifact.zip"
gh api "repos/$repo/actions/artifacts/$id/zip" > "$dir/artifact.zip" \
|| fail "the artifact $id of run $run did not download"
mkdir -p "$dir/artifact" && unzip -q "$dir/artifact.zip" -d "$dir/artifact" \
|| fail "the artifact $id of run $run did not unpack"
rm -f "$dir/artifact.zip"
echo "take-bootstrap-export: artifact $id of run $run at $(date -u +%H:%M:%SZ)"
touch "$dir/ready"
exit 0
fi
# Every fourth poll, whether the export job ended without its artifact.
if [ $((polls % 4)) -eq 0 ]; then
state=$(gh api "repos/$repo/actions/runs/$run/jobs?filter=latest&per_page=100" --paginate \
--jq '.jobs[] | select(.name == "bootstrap export") | "\(.status) \(.conclusion)"' 2>/dev/null) || state=
case "$state" in
"completed success") ;; # uploaded: the next listing shows it
completed*) fail "the bootstrap export job of run $run ended: $state" ;;
esac
fi
polls=$((polls + 1))
sleep 30
done
88 changes: 88 additions & 0 deletions .github/scripts/test_host_lanes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
"""Behavioral tests of the host lanes' join (SPEC §8.3), run in honesty."""

import copy
from pathlib import Path
import sys
import unittest

sys.path.insert(0, str(Path(__file__).resolve().parent))
import host_lanes # noqa: E402

BDD = {"parts": {"one": ["AA-01"], "two": ["AA-02"]}, "targets": {"honesty": ["bdd"]}, "remainder": "rest"}
PLAN = {"producer": ["honesty"], "lanes": {"a": ["one"], "b": ["two", "rest"]}}
NAMES = ["producer", "a", "b"]
HERE = {"commit": "c" * 40, "tree": "t" * 40, "run": "7", "attempt": "1"}
HARNESS = ["conformance_aa_01", "conformance_aa_02", "conformance_aa_03"]


def receipts():
base = {"schema": 1, "target": "x86_64-pc-windows-msvc", "passed": True, "conformance": HARNESS,
"whole": None, **HERE}
return {
"producer": {**base, "lane": "producer", "executed": ["meta", "unit"],
"whole": sorted(["meta", "unit", *HARNESS])},
"a": {**base, "lane": "a", "executed": ["conformance_aa_01"]},
"b": {**base, "lane": "b", "executed": ["conformance_aa_02", "conformance_aa_03"]},
}


class Join(unittest.TestCase):
def check(self, value):
return host_lanes.check_join(value, NAMES, PLAN, BDD, HERE)

def refuse(self, value):
with self.assertRaises(host_lanes.Invalid):
self.check(value)

def test_complete_lanes_pass(self):
self.assertEqual(self.check(receipts()), 5)

def test_missing_lane(self):
value = receipts()
del value["b"]
self.refuse(value)

def test_test_run_twice(self):
value = receipts()
value["a"]["executed"].append("conformance_aa_02")
self.refuse(value)

def test_test_lost(self):
value = receipts()
value["b"]["executed"] = ["conformance_aa_02"]
self.refuse(value)

def test_failed_lane(self):
value = receipts()
value["a"]["passed"] = False
self.refuse(value)

def test_other_commit_or_run(self):
for field in ("commit", "tree", "run"):
value = receipts()
value["a"][field] = "x"
self.refuse(value)

def test_different_harness(self):
value = receipts()
value["b"] = copy.deepcopy(value["b"])
value["b"]["conformance"] = HARNESS[:2]
self.refuse(value)

def test_conformance_lane_outside_harness(self):
value = receipts()
value["a"]["executed"] = ["meta"]
value["producer"]["executed"] = ["conformance_aa_01", "unit"]
self.refuse(value)

def test_named_test_absent(self):
value = receipts()
for receipt in value.values():
receipt["conformance"] = ["conformance_aa_02", "conformance_aa_03"]
value["producer"]["whole"] = sorted(["meta", "unit", "conformance_aa_02", "conformance_aa_03"])
value["a"]["executed"] = []
self.refuse(value)


if __name__ == "__main__":
unittest.main()
Loading
Loading