Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
64 changes: 38 additions & 26 deletions docs/status-json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ directly to keys in the document:
| **architecture** | A GPU target, for example `gfx942` or `gfx1201` (the same identifiers ROCm uses). |
| **pipeline** | One product built from a release: `rocm` (the ROCm stack itself), `pytorch`, `jax`, and `native_packages`. A release can produce several. |
| **phase** | A stage of a pipeline: `build` and `test`. For `native_packages`, `rpm` or `deb` instead. |
| **build variant** | The release flavor, `release` or `asan-debug`. It selects the document: `status.json` for `release`, `status-<build_variant>.json` otherwise. |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right now we have status-asan-debug.json
i wonder if for easier parsing status_asan-debug.json would be the better way? any opinion?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will give it a try

| **variant** | For PyTorch/JAX, one cell of the version matrix (for example Python 3.12 with a given Torch branch). Relevant only to consumers of PyTorch/JAX detail. |

Not every pipeline runs on every platform, and `native_packages` is a special
Expand All @@ -70,36 +71,46 @@ below.

## Endpoints

Quartz publishes one `status.json` per release build (nightly/nightly-bkc/prerelease), plus stable pointers to the
most recent builds.

| Endpoint | Points to |
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- |
| `nightly/<date>/status.json` | A specific nightly, for example `nightly/20260707/status.json` |
| `nightly/latest.json` | The most recent nightly (any result, including still in progress) |
| `nightly/latest_good.json` | The most recent fully-passing nightly |
| `nightly-bkc/<nightly-version>/<bkc-date>/status.json` | A specific bkc nightly, for example `nightly-bkc/10.1.0a20260825/20260831/status.json` |
| `nightly-bkc/<nightly-version>/latest.json` | The most recent bkc nightly for that nightly version (any result, including still in progress) |
| `nightly-bkc/<nightly-version>/latest_good.json` | The most recent fully-passing bkc nightly for that nightly version |
| `nightly-bkc/latest.json` | The most recent build of the highest bkc nightly version (by version number, not build date) |
| `nightly-bkc/latest_good.json` | The highest-versioned fully-passing bkc build (may trail `latest.json` when the highest nightly version is not green) |
| `prerelease/<major.minor>/<full>/status.json` | A specific prerelease, for example `prerelease/7.14/7.14.0rc1/status.json` |
| `prerelease/latest.json` | The highest-versioned prerelease across all release lines (by version number, not build date) |
| `prerelease/<major.minor>/latest.json` | The highest-versioned prerelease in one release line, e.g. `prerelease/7.14/latest.json` |
Quartz publishes one document per build variant, all sharing the same schema:
`status.json` for the release build and `status-asan-debug.json` for the ASAN
build. Each variant has its own stable pointers, so a build of one never moves

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are stable pointers? need probably explanation.

might be easier to just write

Each variant has its own stable? endpoints like latest.json/latest_asan-debug.json to point to the latest runs.

the other's.

Below, `<v>` stands for the variant suffix: empty for the release build,
`-asan-debug` for ASAN. So `status<v>.json` is either `status.json` or
`status-asan-debug.json`.

The ASAN build is filed under the same version and date as the release build
it was cut alongside: its `rocm_version` omits the `.asan` / `+asan` marker its
packages carry (for example `10.2.0a20261005`, not `10.2.0a20261005.asan`).

| Endpoint | Points to |
| --------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `nightly/<date>/status<v>.json` | A specific nightly build of that variant |
| `nightly/latest<v>.json` | The most recent build of that variant (including still in progress) |
| `nightly/latest_good<v>.json` | The most recent fully-passing build of that variant |
| `nightly-bkc/<nightly-version>/<bkc-date>/status<v>.json` | A specific BKC nightly build of that variant |
| `nightly-bkc/<nightly-version>/latest<v>.json` | The most recent BKC build of that variant for the nightly version |
| `nightly-bkc/<nightly-version>/latest_good<v>.json` | The most recent fully-passing BKC build of that variant for the nightly version |
| `nightly-bkc/latest<v>.json` | The most recent build of that variant for the highest BKC nightly version |
| `nightly-bkc/latest_good<v>.json` | The highest-versioned fully-passing BKC build of that variant |
| `prerelease/<major.minor>/<full>/status<v>.json` | A specific prerelease build of that variant |
| `prerelease/latest<v>.json` | The highest-versioned prerelease of that variant across all release lines |
| `prerelease/<major.minor>/latest<v>.json` | The highest-versioned prerelease of that variant in one release line |

Each is served as raw content. The raw URL form is:

```text
https://raw.githubusercontent.com/ROCm/quartz/main/nightly/latest.json
```

> **Note on the pointer files:** Every `latest.json` and `latest_good.json` pointer
> is a git symlink to the dated `status.json` it currently points at. Raw GitHub
> serves a symlink as its target path (a one-line body like `20260707/status.json`),
> not the file it points to, so a plain fetch returns that path rather than JSON. The
> Python helper `load_status` follows this pointer for you transparently; if you
> fetch it yourself, resolve the returned path against the pointer URL and fetch
> again.
> **Note on the pointer files:** Every `latest*.json` and `latest_good*.json`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* vs <v> for the build variant? should be uniform throughout the document

> pointer is a git symlink to the concrete `status*.json` it currently points
> at. Raw GitHub serves a symlink as its target path (a one-line body like
> `20260707/status-asan-debug.json`), not the file it points to, so a plain fetch
> returns that path rather than JSON. The Python helper `load_status` follows

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> returns that path rather than JSON. The Python helper `load_status` follows
> returns that path rather than JSON. The Python helper `read_status_json.load_status()` follows

is this better?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naming wise, I'll always take your solutions :)

> this pointer for you transparently; if you fetch it yourself, resolve the
> returned path against the pointer URL and fetch again.

> **Note on `latest_good.json`:** "Fully passing" means the build's
> `summary.overall_status` is `success` (a worst-of rollup, so this implies the
Expand All @@ -108,9 +119,10 @@ https://raw.githubusercontent.com/ROCm/quartz/main/nightly/latest.json
> regresses to an in-progress or failed build. Because it points at the live
> document rather than a copy of it, a build can stop being green after the
> pointer was written (a re-run re-opens it, or a late leaf fails it); the pointer
> is then withdrawn until some build is green again, so treat a missing
> `latest_good.json` as "nothing good to offer right now". Prerelease has no
> `latest_good.json` pointer yet.
> then falls back to the newest build of that variant still passing, and is
> dropped entirely when none is left, so treat a missing pointer as "nothing good
> to offer right now". Prerelease has no `latest_good.json` pointer yet, for
> any build variant.

> These endpoints go live as TheRock release workflows are instrumented to report
> to Quartz. Until a given release type is instrumented, its files may be absent.
Expand Down
6 changes: 3 additions & 3 deletions docs/status-json/status_json_reference.jsonc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Reference layout for status.json v2.
// Reference layout for status.json and status-asan-debug.json v2.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont think we need to add this here? the layout should be the same independent of the build variant

// NOTE: This file is a human-readable spec and contains `//` comments. The
// real status.json emitted by Quartz is strict JSON with comments stripped.
//
Expand All @@ -21,9 +21,9 @@
{
"schema_version": "2.1",
"release_type": "nightly", // "nightly" | "rc" | "dev"
"rocm_version": "7.13.0a20260408",
"rocm_version": "7.13.0a20260408", // the release version without the ASAN `.asan` / `+asan` package marker, so both variants share one value

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we need an offline discussion about this

"build_date": "20260408", // the date this build is filed under; for nightly-bkc it is the bkc run date from the version's `+bkc.<date>` suffix, not the nightly date the build was cut from
"build_variant": "release", // (schema 2.1) build flavor: "release" | "asan" | ... ; "" when present but no signal yet (before the setup run reports); key absent entirely in pre-2.1 documents
"build_variant": "release", // (schema 2.1) build flavor: "release" (status.json) | "asan-debug" (status-asan-debug.json); "" when present but no signal yet (before the setup run reports); key absent entirely in pre-2.1 documents
"therock_commit": "db2fd412ed7fcadf306cdcf19f09cdd998544197", // (schema 2.1) 40-hex TheRock commit the release was built from; "" until the setup run resolves it; key absent entirely in pre-2.1 documents
"trigger_workflow_run_id": 12340000, // run_id of the orchestrator (multi_arch_ci)
"trigger_run_attempt": 1, // attempt of the owning orchestrator run; ownership is the (trigger_workflow_run_id, trigger_run_attempt) pair, so a GitHub re-run (same run id, higher attempt) supersedes the run before it
Expand Down
4 changes: 2 additions & 2 deletions scripts/consumer/read_status_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ def release_type(self) -> str:

@property
def build_variant(self) -> str | None:
"""Build flavor this release was produced with: "release", or a
sanitizer build such as "asan" (added in schema 2.1).
"""Build flavor this release was produced with: "release", or
"asan-debug" for the ASAN build (added in schema 2.1).

Three states, deliberately distinct: None means the key is absent -- a
pre-2.1 document that predates the field, so the producer cannot tell
Expand Down
144 changes: 135 additions & 9 deletions scripts/receive_therock/tests/therock_classify_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from therock_classify import (
classify,
derive_architectures,
derive_build_variant,
derive_deb_urls,
derive_effective_owner_run_id,
derive_platform_and_pipeline,
Expand Down Expand Up @@ -84,6 +85,29 @@ def test_framework_composite_stripped_to_rocm_part(self):
rec = _make_record(rocm_version="torchvision-0.23.0a0+rocm7.14.0a20260520")
self.assertEqual(derive_release_version(rec), "7.14.0a20260520")

def test_asan_marker_is_dropped(self):
# ASAN versions from TheRock#7508: `.asan` appended, or `+asan` when the
# version has no local segment yet.
cases = {
"10.2.0a20261005.asan": "10.2.0a20261005",
"10.2.0a20261005+asan": "10.2.0a20261005",
"10.2.0rc1.asan": "10.2.0rc1",
"10.2.0rc1+asan": "10.2.0rc1",
"10.1.0a20260811+bkc.20260813.asan": "10.1.0a20260811+bkc.20260813",
"2.12.0+rocm10.1.0a20260823.asan": "10.1.0a20260823",
"2.13.0+rocm10.1.0a20260811.bkc.20260813.asan": (
"10.1.0a20260811+bkc.20260813"
),
}
for raw, expected in cases.items():
with self.subTest(raw=raw):
rec = _make_record(rocm_version=raw)
self.assertEqual(derive_release_version(rec), expected)

def test_asan_inside_a_version_is_not_a_marker(self):
rec = _make_record(rocm_version="7.10.0.dev0+asanfeature")
self.assertEqual(derive_release_version(rec), "7.10.0.dev0+asanfeature")

def test_torch_version_fallback_end_to_end(self):
# test_pytorch_wheels_full.yml only carries `torch_version` (see
# WorkflowRunRecord.from_dict's rocm_version fallback chain); confirm
Expand Down Expand Up @@ -162,6 +186,29 @@ def test_independent_of_version_string(self):
rec = _make_record(rocm_version="7.13.0", release_type="dev")
self.assertEqual(derive_release_type(rec), "dev")

def test_scheduled_asan_orchestrator_is_nightly(self):
# rockrel's scheduled run reports `toJSON(inputs) == {}`.
run = _orchestrator_run(".github/workflows/multi_arch_release_asan.yml")
run.trigger_event = "schedule"
self.assertEqual(derive_release_type(run), "nightly")

def test_dispatched_asan_orchestrator_keeps_its_declared_type(self):
run = _orchestrator_run(".github/workflows/multi_arch_release_asan.yml")
run.trigger_event = "workflow_dispatch"
run.release_type = "prerelease"
self.assertEqual(derive_release_type(run), "prerelease")

def test_undeclared_type_is_only_inferred_for_scheduled_asan_orchestrator(self):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will probably elaborate on this later. but i drop it here so i dont forget:

asan releases and normal releases have the same setup in the workflow. so we should not do the special treatement here in quartz for asan.

claude:

  • derive_release_type asan inference is dead code. therock_classify.py:298-303 infers nightly for a scheduled release-asan orchestrator with no declared type. But both rockrel wrappers pass release_type: ${{ inputs.release_type || 'nightly' }} (asan wrapper L68, normal L83), so the asan orchestrator always has inputs.release_type == "nightly" and line 296 returns first. The branch never runs.
    • Test premise is false: therock_classify_test.py:190 claims scheduled asan reports toJSON(inputs) == {}; rockrel never produces that.
    • Fix: reduce derive_release_type to return wr.release_type or ""; drop test_scheduled_asan_orchestrator_is_nightly; collapse the "only-inferred" guard test to "undeclared → empty"; remove the stale docstring paragraph.

dispatched = _orchestrator_run(".github/workflows/multi_arch_release_asan.yml")
dispatched.trigger_event = "workflow_dispatch"
release = _orchestrator_run()
release.trigger_event = "schedule"
leaf = _leaf_run()
leaf.trigger_event = "schedule"
for run in (dispatched, release, leaf):
with self.subTest(path=run.path, event=run.trigger_event):
self.assertEqual(derive_release_type(run), "")


_THEROCK_SHA = "0123456789abcdef0123456789abcdef01234567"

Expand Down Expand Up @@ -763,6 +810,11 @@ def test_top_level_orchestrator_is_self(self):
run.workflow_run_id = 29079513704
self.assertEqual(derive_effective_owner_run_id(run), 29079513704)

def test_top_level_asan_orchestrator_is_self(self):
run = _orchestrator_run(".github/workflows/multi_arch_release_asan.yml")
run.workflow_run_id = 29079513705
self.assertEqual(derive_effective_owner_run_id(run), 29079513705)

def test_descendant_uses_quartz_tracking_id(self):
# Every triggered workflow carries the top-level owner in the propagated
# id, regardless of its immediate GitHub parent.
Expand All @@ -774,16 +826,25 @@ def test_descendant_uses_quartz_tracking_id(self):
}
self.assertEqual(derive_effective_owner_run_id(run), 29079513704)

def test_run_id_parsed_without_release_type_suffix(self):
# The `;<release_type>` half must not leak into the run id, and a bare
# id with no separator still parses.
semi = _leaf_run()
semi.inputs = {"quartz_tracking_id": "29079513704;"}
self.assertEqual(derive_effective_owner_run_id(semi), 29079513704)
def test_three_field_id_supplies_the_owner(self):
run = _leaf_run()
run.inputs = {"quartz_tracking_id": "29079513704;nightly;asan-debug"}
self.assertEqual(derive_effective_owner_run_id(run), 29079513704)

def test_too_few_tracking_id_fields_raise(self):
# The release type is required; a bare run id is a producer bug.
for value in ("29079513704", "29079513704;"):
with self.subTest(value=value):
run = _leaf_run()
run.inputs = {"quartz_tracking_id": value}
with self.assertRaises(ValueError):
derive_effective_owner_run_id(run)

bare = _leaf_run()
bare.inputs = {"quartz_tracking_id": "29079513704"}
self.assertEqual(derive_effective_owner_run_id(bare), 29079513704)
def test_too_many_tracking_id_fields_raise(self):
run = _leaf_run()
run.inputs = {"quartz_tracking_id": "29079513704;nightly;asan;extra"}
with self.assertRaises(ValueError):
derive_effective_owner_run_id(run)

def test_no_quartz_tracking_id_returns_none(self):
# Untracked runs (CI, tracking disabled) carry no owner: the immediate
Expand All @@ -799,6 +860,71 @@ def test_empty_quartz_tracking_id_returns_none(self):
self.assertIsNone(derive_effective_owner_run_id(run))


class DeriveBuildVariantTest(unittest.TestCase):
def test_tracking_id_wins_over_direct_input(self):
# A run's own `build_variant` input never picks the document: only the
# orchestrator-stamped id does.
run = _leaf_run()
run.inputs = {
"build_variant": "release",
"quartz_tracking_id": "123;nightly;asan-debug",
}
self.assertEqual(derive_build_variant(run), "asan-debug")

def test_tracking_id_supplies_descendant_variant(self):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets also test too many elements or too little in the tracking id

run = _leaf_run()
run.inputs = {"quartz_tracking_id": "123;nightly;asan-debug"}
self.assertEqual(derive_build_variant(run), "asan-debug")

def test_two_field_tracking_id_is_release(self):
run = _leaf_run()
run.inputs = {
"quartz_tracking_id": "123;nightly",
"build_variant": "asan-debug",
}
self.assertEqual(derive_build_variant(run), "release")

def test_untracked_run_has_no_variant(self):
# A direct input without a tracking id (manual dispatch, CI) claims nothing.
run = _leaf_run()
run.inputs = {"build_variant": "asan-debug"}
self.assertEqual(derive_build_variant(run), "")

def test_untracked_run_with_asan_version_is_asan_debug(self):
# e.g. an ownerless PyTorch test leaf carrying only an ASAN torch version.
for version in ("2.12.0+rocm10.1.0a20260823.asan", "10.2.0a20261005+asan"):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have the quartz tracking id.
i dont think we should do the assumptions here

with self.subTest(version=version):
run = _leaf_run()
run.rocm_version = version
self.assertEqual(derive_build_variant(run), "asan-debug")

def test_too_few_tracking_id_fields_raise(self):
run = _leaf_run()
run.inputs = {"quartz_tracking_id": "123"}
with self.assertRaises(ValueError):
derive_build_variant(run)

def test_too_many_tracking_id_fields_raise(self):
run = _leaf_run()
run.inputs = {"quartz_tracking_id": "123;nightly;asan;extra"}
with self.assertRaises(ValueError):
derive_build_variant(run)

def test_release_orchestrator_is_release(self):
run = _orchestrator_run()
run.inputs = {"build_variant": "asan-debug"}
self.assertEqual(derive_build_variant(run), "release")

def test_asan_orchestrator_is_always_asan_debug(self):
# rockrel's report carries no `build_variant` input (a scheduled run
# carries no inputs at all); any input it does carry is ignored.
for inputs in ({}, {"build_variant": "asan"}):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no.
if for the top level orchestrator we have an input, we take the input in original writing. not overwriting it with some other asan or whatever

with self.subTest(inputs=inputs):
run = _orchestrator_run(".github/workflows/multi_arch_release_asan.yml")
run.inputs = inputs
self.assertEqual(derive_build_variant(run), "asan-debug")


class ClassifyOwnerNormalizationOrderingTest(unittest.TestCase):
"""`classify()` must normalize the owner AFTER deriving source_run_id.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"release_type": "nightly",
"inputs": {
"build_variant": "release",
"quartz_tracking_id": "27797822900;nightly",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"quartz_tracking_id": "27797822900;nightly",
"quartz_tracking_id": "27797822900;nightly;release",

please also check the other fixtures

"release_type": "nightly",
"prerelease_version": "",
"linux_amdgpu_families": "all",
Expand Down
Loading