fix: Quartz mis-reports pytorch/jax matrix-job test results - #71
Conversation
| "publish_no_rocm_image_ubuntu24_04_rocgdb.yml", | ||
| # Upstream test scaffolding (not Quartz-reported). | ||
| "test_artifacts_structure.yml", | ||
| # Registered separately in users/cgoea/fix_test_artifacts; excluded |
There was a problem hiding this comment.
? probably want to remove that :)
There was a problem hiding this comment.
Good catch, that was leftover from rebasing against users/cgoea/fix_test_artifacts. Removed in 6f2438a — develop already carries test_component.yml/test_jax_dockerfile.yml without that comment, so this branch's diff for the file is now a no-op.
| # must fall back to the uppercase ancestor instead of being dropped. | ||
| run = _variant_run( | ||
| pipeline_type="jax", | ||
| pipeline_phase="build", |
There was a problem hiding this comment.
as it is build phase shouldnt it kick out jobs that are "test"?
There was a problem hiding this comment.
No -- this is intentional and predates this PR (see test_reusable_matrix_nested_jobs_collapse_to_one_variant_per_cell, already on develop). test_pytorch_wheels.yml/test_linux_jax_wheels.yml run as a reusable workflow_call nested inside the delegated build orchestrator, not as their own workflow_dispatch -- so their jobs land in the same job list, same run id, as the build. _variants_from_jobs deliberately groups every job sharing a (py, ref) cell, build and nested test alike, into one Variant, because that's the only way _refresh_same_run_fanout_tests can see a cell's test outcome before the top-level run finishes. Filtering out "Test"-named jobs here would break that early-projection path. I expanded the docstring on _refresh_same_run_fanout_tests (6f2438a) to spell this out -- let me know if that answers it or if you want the filtering anyway for a different reason.
There was a problem hiding this comment.
PyTorch/JAX test coverage runs as a reusable workflow_call nested inside the delegated build orchestrator so build and test jobs share one job list/run id, and _variants_from_jobs intentionally groups them together per py, ref cell so test outcomes can be seen before the top-level run finishes.
| ): | ||
| return False | ||
|
|
||
| projected_status = Variant.rollup_status(leaf.variants, leaf.status) |
There was a problem hiding this comment.
shouldnt leaf.status become part of the valid rollup?
or should have at least some form of overwriting force if it is cancelled or failure?
There was a problem hiding this comment.
Yes, good point -- fixed in 6f2438a. Since leaf.variants is guaranteed non-empty at this call site (checked above), leaf.status was only ever used as an empty-variants fallback and never actually influenced the result -- so a cancelled/failed run whose per-cell variants happened to look clean (e.g. a cell whose job never started and so never shows up in variants at all) would silently report the variants' rollup instead of the real outcome. Changed it to fold leaf.status into the rollup itself: rollup_statuses((*(v.status for v in leaf.variants), leaf.status), leaf.status). Added test_fanout_projection_folds_raw_run_conclusion_into_rollup to cover exactly that (all-success variants, but the run itself was cancelled).
| completion is classified as the build phase, so it would otherwise leave | ||
| those same-run test leaves stale. | ||
|
|
||
| `leaf.status` is the *build* run's own top-level GitHub conclusion, which |
There was a problem hiding this comment.
build?
and where do we do the splitting for pytorch that has build and tests in the same workflow job list (as for testing it uses reusable worklfows and not workflow disaptch)
There was a problem hiding this comment.
Fair -- "build" was ambiguous and I'd left a stale reference to a function (_merge_variant_leaf) that doesn't actually exist (it's _merge_matrix_build_leaf). Rewrote the docstring in 6f2438a to answer the splitting question directly: there is no job-name-level split. test_pytorch_wheels.yml/test_linux_jax_wheels.yml run as a reusable workflow_call nested inside the delegated release workflow, not their own workflow_dispatch, so their jobs share the same run id and job list as the entry build, and the registry (WORKFLOW_SPECS) classifies the whole thing as pipeline_phase="build". _variants_from_jobs groups build+test jobs into one Variant per (py, ref) cell regardless, and this function is what re-projects that already-merged variant list onto the separately-tracked test-phase leaf (matched by run_id/run_attempt), since the test-phase's own notification can be classified/arrive independently.
There was a problem hiding this comment.
rewriting in a better way
|
also please adjust pr title to something non experts also get an idea what this is doing. |
Same-run test-leaf projection ignored the build run's own terminal conclusion unless variants were empty, so a top-level cancellation/ failure could be masked by whatever individual matrix cells happened to report. Fold leaf.status into the rollup instead of only using it as an empty-variants fallback. Also drop a stale comment left over from a rebase referencing an unrelated branch, and clarify the same-run fanout docstring (fix a reference to a function that doesn't exist, and explain why build and test jobs share one job list for these delegated PyTorch/JAX runs).
|
Addressed all four review comments in 6f2438a:
Replied inline to each thread with more detail. |
| assert leaf.variants[0].status is Status.failure | ||
|
|
||
|
|
||
| def test_fanout_projection_folds_raw_run_conclusion_into_rollup() -> None: |
There was a problem hiding this comment.
i think here is an error
if i understand the test correctly:
pytorch test for gfx110X-all
have a in_progress run on linux
have a successful test run but cancel the entire pytorch testing run on windows
now at the end when checking the status of linux should copy from windows and show cancelled?
that does not make sense because windows and linux have separate pytorch workflows. so this kind of rollup should only happen within a platform.
There was a problem hiding this comment.
No, no. agree it reads as confusing, since it looks like it's testing platform mixing when it's really testing field-independence. the reason the test sets cancelled_build.classification.platform = "windows" while the stale leaf is "linux" (both keyed to the same run_id=903) is to deliberately prove the matching predicate really is just (run_id, run_attempt) and doesn't silently depend on platform equality. I'll drop the platform override in my new test (default to "linux", matching the stale leaf).
There was a problem hiding this comment.
and doesn't silently depend on platform equality
but it should depend on the platform. pytorch test on windows are totally independent of linux - even for the same arch
test_fanout_projection_folds_raw_run_conclusion_into_rollup doesn't need a platform mismatch to make its point (that's already covered by test_completed_fanout_build_refreshes_same_run_test_leaves), and it read as if a windows run could leak into a linux leaf. Drop it there, and add a comment on the older test explaining why the mismatch is intentional where it remains.
…Quartz into users/cgoea/fix_matrix_job
…trix_job # Conflicts: # scripts/receive_therock/tests/therock_update_status_json_test.py
Motivation
Two related bugs cause pytorch/jax test results to be silently dropped or mis-reported in status.json:
Cancelled/failed JAX test jobs silently disappear from variants. A calling orchestrator (e.g. rockrel) can wrap TheRock's own build job in a differently-cased ancestor segment. The nested test job has no (py, ref) segment of its own and relies entirely on that uppercase JAX ancestor being recognized — but the matrix-cell regex only matched lowercase jax/torch, so the job was invisible and its status (e.g. cancelled) never made it into the leaf's variants.
Pytorch test leaves report the wrong status per arch. A projected test leaf was inheriting the build run's raw GitHub conclusion verbatim instead of the worst-of rollup of its own variants, so leaves showed status: success while every variant underneath showed failure — observed across 16 linux architectures in pytorch.test.
closes #70
Technical Details
therock_update_status_json.py:
Made _MATRIX_JOB_RE case-insensitive and switched from .search() (first match) to taking the last match in a job's composite name -- a job's own tail segment (closest to the actual job) is authoritative, with an ancestor segment used only as a fallback when the job has no segment of its own.
_refresh_same_run_fanout_tests now recomputes the projected leaf's status via Variant.rollup_status(leaf.variants, leaf.status) instead of copying the build run's raw conclusion, matching how every other variant-carrying leaf derives its status.
Test Plan
Ran the full scripts/receive_therock/tests/ suite.
Test Result
402 passed.
Submission Checklist