Closed Bug 2020777 Opened 9 months ago Closed 9 months ago

Dynamic chunking underestimates runtime for manifests with included sub-manifests

Categories

(Firefox Build System :: Task Configuration, defect)

defect

Tracking

(firefox-esr140 unaffected, firefox148 unaffected, firefox149 unaffected, firefox150 fixed)

RESOLVED FIXED
150 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox148 --- unaffected
firefox149 --- unaffected
firefox150 --- fixed

People

(Reporter: florian, Assigned: florian)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 external file)

resolve_dynamic_chunks in chunk.py computes the number of chunks needed for a test suite by summing per-manifest runtimes from the runtime data. However, it only matches manifests by exact key, ignoring colon-separated runtime keys like manifest.toml:included.toml that represent included sub-manifests. This causes it to severely underestimate the total runtime for suites like xpcshell where some manifests include others (e.g. xpcshell-remote.toml includes xpcshell-common.toml).

For example, on Android shippable/opt, toolkit/components/extensions/test/xpcshell/xpcshell-remote.toml has a direct runtime of only 5.9s, but its included xpcshell-common.toml adds 226.6s. The chunk count calculation sees only 5.9s, producing too few chunks.

Meanwhile, chunk_manifests in chunking.py (which distributes manifests across chunks) already correctly aggregates colon-separated keys into their parent manifests. This creates an inconsistency: the chunk count is computed from an underestimated total, but the balancing algorithm sees the real runtime.

The fix extracts the colon-key aggregation logic from chunk_manifests into a shared resolve_manifest_runtimes helper function and uses it from both resolve_dynamic_chunks and chunk_manifests.

This explains the very poor dynamic chunking we see for android xpcshell tests at https://tests.firefox.dev/xpcshell-jobs.html#autoland-android-tests

resolve_dynamic_chunks was ignoring colon-separated runtime data keys (e.g. manifest.toml:included.toml) when computing chunk counts, causing it to underestimate the total runtime for manifests that include sub-manifests. The existing chunk_manifests function already handled this correctly for chunk balancing. Extract the shared logic into resolve_manifest_runtimes and use it from both call sites.

Set release status flags based on info from the regressing bug 2017946

Pushed by fqueze@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/3104945a406d https://hg.mozilla.org/integration/autoland/rev/4fb21ed64b2b Fix dynamic chunk count underestimation for manifests with includes, r=ahal,taskgraph-reviewers.
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: