Skip to content

feat: enable asan build in quartz - #110

Merged
cgoea merged 5 commits into
developfrom
users/cgoea/asan_build
Oct 12, 2026
Merged

cgoea merged 5 commits into
developfrom
users/cgoea/asan_build

Conversation

@cgoea

@cgoea cgoea commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Closes #108.

Merge only after rockrel/TheRock are wired

ASAN releases currently have nowhere to land. Since #77 they are recognised and
then deliberately dropped, so an ASAN nightly produces no published status at
all. PR depends and is based on top of #102

This gives every build variant its own document and its own pointers, so ASAN
results are published without a release build and an ASAN build ever being able
to overwrite one another.

Technical Details

Per-variant documents. _StatusDocumentKind keys a document by build
variant, with the member value doubling as the filename suffix ("" for
release, "-asan" for ASAN).

Per-variant pointers. _pointer_filename applies the same suffix to every
latest / latest_good pointer, across nightly, nightly-bkc (including the
top-level cross-version pointers) and prerelease. The resulting tree is the one
in the issue.

Finalization. FINALIZING_PHASES now includes release-asan, so the ASAN
orchestrator owns and finalizes its own document.

Tracking id. quartz_tracking_id is extended to
<run_id>;<release_type>;<build_variant>.

build_pytorch: false and build_jax: false are passed to the
setup job, so PyTorch and JAX alreadyrender skipped and will
not hold the ASAN rollup at in_progress.

Test Plan

  • 16 new tests covering document selection per variant, pointer naming across
    all three release tiers, independent finalization of the release and ASAN
    documents, rejection of unregistered sanitizer families, rejection of ASAN
    leaves against a normally-owned document, and the publication gate.

Test Result

580 passed

Submission Checklist

@cgoea
cgoea requested a review from a team September 15, 2026 09:04
@cgoea cgoea changed the title Users/cgoea/asan build feat: enable asan build in quartz Sep 15, 2026
@cgoea
cgoea changed the base branch from main to develop September 15, 2026 09:05

@marbre marbre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

PR depends and is based on top of #102

Can you transform this into a stacked PR? I don't want to review the BKC changes twice.

@cgoea
cgoea changed the base branch from develop to users/lpromber/bkc September 16, 2026 15:10
@cgoea

cgoea commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

PR depends and is based on top of #102

Can you transform this into a stacked PR? I don't want to review the BKC changes twice.

done

@cgoea
cgoea requested a review from marbre September 17, 2026 08:32
@cgoea
cgoea changed the base branch from users/lpromber/bkc to develop September 18, 2026 14:10
@cgoea
cgoea force-pushed the users/cgoea/asan_build branch from b99647c to 050b59e Compare September 28, 2026 09:00
@cgoea
cgoea force-pushed the users/cgoea/asan_build branch from 050b59e to b012ca9 Compare September 28, 2026 09:07

@HereThereBeDragons HereThereBeDragons left a comment

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.

as you will see in several of my comments i think it is best to have one status json for each build variant (guard by which we want to record) and not mix multiple asan builds into one.

and then is the question if we first ready the prs in therock/rockrel before merging this - which is probably the easier way to go for that version. there is one comment about what extras we need to do there to make it easier for us

Comment thread docs/status-json/README.md Outdated
| **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, such as `release`, `asan`, or `asan-debug`. It selects the document: `status.json` for `release`, `status-asan.json` for either ASAN flavor. |

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.

remove asan-debug. we dont have this yet in therock. let also just say that "asan" goes in status-asan.json. maybe have status.json for release and anything else is status-<buildvariant>.json

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.

ok, thought it's good to have for the future. now it's status.json for release and status-<build_variant>.json for anything else.

Comment thread docs/status-json/README.md Outdated
| `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 family, all sharing the same
schema. The normal release build gets the unsuffixed `status.json`; ASAN builds

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 only publish status.json and status-asan.json. not all buildvaraints

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.

same as above, but ok, making it fit the current behaviour.

Comment thread docs/status-json/README.md Outdated
schema. The normal release build gets the unsuffixed `status.json`; ASAN builds
get `status-asan.json`. The suffix follows TheRock's own `build_variant_suffix`,
which folds the debug flavor onto its base family, so both `asan` and
`asan-debug` publish to `status-asan.json` and the document's `build_variant`

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.

as said before we probably want to limit this

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.

done

Comment thread docs/status-json/README.md Outdated
| `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 |

> **The sanitizer endpoints are not published yet.** TheRock's

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.

remove that part. adding therock/rockrel to release it will be quick

"rocm_version": "7.13.0a20260408",
"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" | "asan" | "asan-debug" | ... ; in status-asan.json this is the one field distinguishing the ASAN flavors; "" when present but no signal yet (before the setup run reports); key absent entirely in pre-2.1 documents

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 remove asan-debug here

return repo_dir / "nightly" / _NIGHTLY_DATE / "status.json"


def _nightly_sanitizer_status_path(repo_dir: Path) -> Path:

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
def _nightly_sanitizer_status_path(repo_dir: Path) -> Path:
def _nightly_asan_status_path(repo_dir: Path) -> Path:

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.

renamed

assert doc.trigger_workflow_run_id == 29079513704


def test_ownerless_pytorch_leaf_is_rejected_from_asan_document(

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.

there are works to enable asan for pytorch. we should not treat it as special. we should rather deactive pytorch/jax as being skipped for asan for the moment in therock. and work with the quartz tracking id

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.

ok, didn't know this. good to know

assert (prerelease_root / "7.14" / "latest-asan.json").readlink() == Path(
"7.14.0rc1/status-asan.json"
)
assert not (prerelease_root / "latest.json").exists()

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.

also assert not status.json?

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.

made somewhat sense for me. anyway, removed

)
bkc_root = tmp_path / "nightly-bkc"
version_root = bkc_root / _BKC_NIGHTLY_VERSION
target = Path(_BKC_DATE) / "status-asan.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.

assert not status.json

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.

added

_event(asan_orchestrator), repo_dir=tmp_path, commit_and_push=False
)

assert out == _nightly_sanitizer_status_path(tmp_path)

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 assert the same thing for both docs

@HereThereBeDragons HereThereBeDragons left a comment

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.

didnt have a look at scripts/receive_therock/tests/therock_update_status_json_test.py

but i think this are enough comments that need applying first.
for the question about keeping .asan in the version or not - we should double check waht they want to do with python asan wheels. for tarballs the .asan is dropped. might need a larger offline discussion.

"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

return str(wr.inputs.get("build_variant") or "").strip()
"""The release flavor this run belongs to: "release", "asan", "asan-debug", ...

Every run of a tracked release reads it from the propagated

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.

please rework the comment to only describe what the function does

Comment thread docs/status-json/README.md Outdated
| **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

Comment thread docs/status-json/README.md Outdated
| `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.

Comment thread docs/status-json/README.md Outdated
> 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

"""Highest-version target across the per-nightly-version `latest_good.json`
pointers under `bkc_root`, as a path relative to `bkc_root`
(`<nightly-version>/<bkc-date>/status.json`), or None when none survive.
def _highest_subdir_good(bkc_root: Path, pointer_name: str) -> Path | None:

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.

is this only for latest_good? then lets not use cryptic names like "pointer_name"

build_variant = c.build_variant.lower()
if build_variant:
return build_variant
if c.pipeline_type == "setup":

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.

setup has the build_variant as input.

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.

ok, using it

return f"{m.group(1)}+bkc.{m.group(2)}" if m else v


# ASAN wheel versions end in an `asan` marker after the regular version (see

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 might need to have keep the .asan

but this should be an easy change so can do this last

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.

ok, kept it

Independent of the version string: a bare `7.13.0` may be published to
the dev bucket, so the version cannot be used to infer the type.

The one undeclared case is rockrel's scheduled `multi_arch_release_asan.yml`:

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.

as i said somehwere else before: lets do it how we do it for the normal release.
latest the top level orchestrator called via workflow call in therock should hav ethe details of the release type

if has_asan_version_marker(wr.rocm_version or ""):
return FINALIZING_PHASE_BUILD_VARIANTS["release-asan"]
return ""
return tracking.build_variant or "release"

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 the "or" part in return tracking.build_variant or "release"
as we will need to merge in therock/rokcrel the changes first before adding them here

@HereThereBeDragons HereThereBeDragons left a comment

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.

1-2 small changes.

other change srequire:

  • merging this pr
  • upgrading quartz tracking id in rockrel
  • removing the intermittent solutions of accepting the old quartz tracking id



def _document_rocm_version(workflow_run: WorkflowRunRecord) -> str:
"""The document's `rocm_version`: the release version with the run's 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.

asan == build variant?

return None

release_type = workflow_run.release_type or ""
if release_type not in _TRACKED_RELEASE_TYPES:

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.

_TRACKED_RELEASE_TYPES lets remove asan for now from here.

we add the code but wait to activate it until the final decision on the asan version schema has been taken

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.

disabled already

derive_build_variant(run)

def test_setup_input_is_taken_verbatim(self):
for tracking_id in ("123;nightly;asan-debug", "123;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.

we should be failing for "123;nightly"
even setup.yml will have a complete quartz_tracking_id with the build variant

that is a todo in the future to drop it. we need a short overlap where we can accept the old 2-entry quartz-trackingid

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.

ok, won't change anything, just a TO DO.

f"in quartz_tracking_id={raw!r}"
) from exc
build_variant: TheRockBuildVariant | None = None
if build_variant_part:

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 will always have build_variant_part. we will merge first the prs in therock/rockrel.
as such just assume quartz_tracking_id is either empty or contains all the parameters we are requesting

that is a todo in the future to drop it. we need a short overlap where we can accept the old 2-entry quartz-trackingid

"""True when `version` (raw or ROCm segment) carries the ASAN marker."""
return bool(_ASAN_VERSION_MARKER_RE.search(_rocm_version_segment(version.strip())))
def derive_version_marker(wr: WorkflowRunRecord) -> str:
"""The ASAN marker ending this run's ROCm version, verbatim, or "".

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 wonder if this should be based on build_variant from teh quartz_tracking_id.

but lets wait until we know what we will do with the asan version before spedning time on it

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.

ok, same here as above

Every other run reads it from the third field of the propagated
`quartz_tracking_id` (`"<run_id>;<release_type>;<build_variant>"`), never
from its own `build_variant` input: only a run triggered by a release
orchestrator carries that id, so a manually dispatched workflow cannot claim

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.

in theory you can set all the quartz_tracking_id manually.. if you do it correctly

so i would just delete the half sentence

top_level = is_top_level_orchestrator(wr)
tracked = str(parse_quartz_tracking_id(wr.inputs).build_variant or "")
if top_level or c.pipeline_type == "setup":
declared = str(wr.inputs.get("build_variant") or "").strip()

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.

setup already has the correctly set quartz_tracking_id including the build variant as input

that is a todo in the future to drop it. we need a short overlap where we can accept the old 2-entry quartz-trackingid

@cgoea
cgoea merged commit 65cda64 into develop Oct 12, 2026
@cgoea
cgoea deleted the users/cgoea/asan_build branch October 12, 2026 17:19
quartz-sync-github-app Bot pushed a commit that referenced this pull request Oct 12, 2026
65cda64, feat: enable asan build in quartz (#110), Ciprian Goea (ciprian.goea@amd.com), Mon Oct 12 20:19:05 2026 +0300
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.

Add ASAN status.json

3 participants