Repository navigation
ci: record compact execution logs on preflight and quality-matrix, and diff two runs to name cache-miss causes - #13781
Merged
Merged
Conversation
…d diff two runs to name cache-miss causes (part of #13724) - ci.yml: the preflight launch smoke and the quality-matrix test step write --execution_log_compact_file and upload it as exec-log-<job>-<platform> (7 days, if: always() behind the secret scan). - exec_log.rs: parse runner, cache_hit, remote_cacheable, digest, total time, args and env of each spawn, and resolve input sets, directories and runfiles trees to file digests. - determinism_check diff <first> <second> [--top N]: prints the slowest spawns that ran in the second log with the inputs, args and env that differ, or why the spawn could not hit the cache. - New fixtures cache_first/cache_second hold a disk cache hit, a miss from a changed input and a no-cache spawn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hz39bWaDqidVSvFZuj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked Issue
Part of #13724
Changes
.github/workflows/ci.yml: thepreflightlaunch smoke and thequality-matrixtest step pass--execution_log_compact_file=$RUNNER_TEMP/exec-log/<step>.log. A secret scan (if: always()) and an upload follow, asexec-log-<job>-<platform>, kept for 7 days.tools/testing/src/exec_log.rs: newExecLogparser reads each spawn's args (1), env (2), input/tool sets (4/5), runner (11), cache_hit (12), remote_cacheable (15), digest (16) and metrics.total_time (18.1).inputs()resolves input sets (entry 6, packed or unpacked ids, transitive sets), directories (expanded to child files) and runfiles trees (entry 10, plus the_repo_mappingmanifest) to path → digest.read/problemskeep their behaviour.exec_log::diffplusdeterminism_check diff <first> <second> [--top N](default 20): prints the slowest spawns that ran in the second log, keyed<label> <mnemonic> <first output>. Each one shows the inputs (first 20, then a count), args and env that differ from the first log. When nothing differs, it says why the spawn could not hit: not remote cacheable, no matching spawn in the first log, or the same action whose result never reached the cache. Test spawns carry no digest, so their inputs are compared directly.exec_log_fixtures/cache_{first,second}.log.zst(Bazel 9.3.1, recipe in the module doc) hold a disk-cache hit, a miss caused by a changed input, and ano-cachespawn..github/workflows/README.md: how to download twoexec-log-*artifacts and diff them.I also checked the reader against a real repo log: I ran
//tools/testing:determinism_check_testtwice with different--test_env. The diff namedenv PROBE: a -> bon the TestRunner spawn and resolved its runfiles tree.Still open on #13724: the
launch-heavyjob (only in draft #13727 so far) needs the same flag and upload. The "done" evidence also needs two consecutive main runs on macos_arm64.Verification
Tested:
bazel test //tools/testing:dx_testing_test //tools/testing:determinism_check_test //tools/ci:secret_flags_test //tools/ci:workflow_files_test //tools/ci:actionlint_test //tools/ci:workflow_expressions_test //tools/ci:input_validation_test //tools/ci:determinism_allowlist_testall pass.tools/dx check --applyon the touched files exits 0. It also regenerated unrelateddepsintools/testing/BUILD.bazel; I reverted that.//tools/ci:prose_rules_test(docs/design/tool-prebuilts.md1363 words) and//tools/ci:zero_compat_test(cli/shim,android/repositories.bzland others) fail on files this PR does not touch. Both are main failures.Not run:
tools/dx check --affected/tools/dx test --affected, and the CI workflow itself.Generated by Claude Code