Skip to content

ci(#6664): Equivalence E2E shards run only what ground-truth cannot; db2 planned from its inputs - #6669

Merged
squid-shepherd[bot] merged 3 commits into
mainfrom
worktree-equivalence-e2e-dedupe
Oct 25, 2026
Merged

squid-shepherd[bot] merged 3 commits into
mainfrom
worktree-equivalence-e2e-dedupe

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Closes #6664.

equivalence-e2e.yml is not a required check, so its wall time never holds a merge. Its cost is the runners it takes from the ~20-job pool the required checks queue on (docs/ci.md #5132). This PR makes two cuts.

1. Shards: only the files whose result can differ from ground-truth's

The 4 shards re-ran all of tests/cobol_mainframe/, which the required ground-truth job already runs. I compared junit outcomes from one run of each workflow on the same commit (E2E run 40225533892, ground-truth run 40225536142, both from a since-dropped measurement commit):

tests shard test time
passed in both (duplicate) 7126 1810 s
ran only in the shards (ground-truth skipped them) 696 3177 s

The 696 sit in 46 files. 41 of them read EQUIVALENCE_E2E. The other 5 are skipped in ground-truth with reasons like "no JDK 17" or a missing jar, without reading the variable. tests/tools/equivalence_e2e_select.py selects a file when it reads the variable or a skip reason names a tool the shards provide (Docker / GnuCOBOL / oracle image / JDK / Maven / jar). That gives 84 files, keeps all 696 shard-only tests, and leaves 188 s of duplicates. Shard test time drops from about 4988 s to 3365 s.

  • 3 shards instead of 4, split over measured seconds in tests/equivalence_e2e_durations.json. .test_durations is recorded by ground-truth, where these tests skip, so it weighs them ~0 s. (The 40 porting-loop tests record 0.0 s there against ~1450 s measured.) The shards now upload their times for refreshing the file; the command is in docs/ci_env_gated_tests.md.
  • test_env_gated_tests_run_in_ci_5954.py expands the selector when it reads the shard pytest line, so its coverage proof still holds. A new test pins the 5 JDK-only files in the selection and keeps two known pure-duplicate files out.

2. db2 job: planned from its inputs

The job takes one runner for ~21 min. On a PR it now runs only when a changed file is an input of the five Db2 files (equivalence_e2e_plan.db2_input):

  • their import closure, computed with ast on every plan (198 modules, 1.7 s), plus the tests/tools scripts they run as subprocesses;
  • the equivalence cases they name;
  • shared harness data under tests/equivalence/;
  • any non-Python file under gitgalaxy/ (fail open);
  • the job's own files.

Replaying the last 80 merged PRs: 21 runs instead of 45. The job failed 10 times, all between 2026-10-24 22:18Z and 2026-10-25 02:10Z. Those were its bring-up, and the samples I checked were the since-fixed corpus fetch. It has failed in none of its last 58 PR runs, and the required det check re-proves the Db2 det ports on every PR. Push, nightly and manual runs always run it. Main Watch now watches Equivalence E2E, so a red nightly opens ci-red-main.

Verification

  • 400 tests across the changed areas and the workflow linters pass locally: planner, CI coverage gap: EQUIVALENCE_E2E / CICS_CRUCIBLE_PATH-gated tests never run in any workflow #5954 guard, main-watch, post-merge dispatch, tested-tree, draft gate, shard-split pin, ci_retry, install pins and others. The ruff audit shows no new findings, and format is clean.

  • I checked that the durations file's 3704 node ids match what pytest collects for the selection; the 4 untimed tests are the --deselected ones.

  • Measured on CI: a branch dispatch of the new layout (run 40228310629) passed: plan, 3 shards, db2 and the aggregate check all green. Shard cost against the before-run (40225533892), both full manual runs:

    Before (4 shards) After (3 shards)
    Shard runner-minutes 50.9 (14.4 / 7.8 / 12.7 / 16.0) 33.2 (11.3 / 11.4 / 10.5)
    Slowest shard 16.0 min 11.4 min

    About 35% fewer shard runner-minutes and one fewer runner; the measured durations even out the shard sizes. The db2 job ran in that dispatch (manual runs always do); the PR-side saving there is from the planner (21 of 80 replayed PRs instead of 45).

  • Local audit_check.py lists 17 mypy findings, all in files this PR doesn't touch (detector.py, galaxyscope.py, cobol_to_java forges). That looks like a different local mypy version; CI's mypy-audit is authoritative.

Reviewer decisions

  • Coverage moved off the PR path: a Db2-file input the closure misses would be caught by the nightly and Main Watch rather than on the PR. The closure fails open on non-Python files and shared harness data.
  • 3 shards: trades a little wall time for one fewer runner request. If you'd rather keep 4, it's a one-line change.

🤖 Generated with Claude Code

squid-protocol and others added 2 commits October 25, 2026 15:20
…db2 job planned from its inputs

The shards re-ran all of tests/cobol_mainframe, which the required ground-truth job already runs. Measured
from junit of one run of each on the same commit (40225533892, 40225536142): 7126 of the 7822 tests the shards
ran also passed in ground-truth (1810 s); the 696 that ran only in the shards (3177 s) are in 46 files.
tests/tools/equivalence_e2e_select.py picks files that read EQUIVALENCE_E2E or whose skip reasons name a tool
the shards provide (Docker / oracle image / JDK / Maven / jar): 84 files, every shard-only test kept, 188 s of
duplicates left. The shards split 3 ways over measured seconds (tests/equivalence_e2e_durations.json;
.test_durations weighs these tests ~0 s because ground-truth records it with them skipped) and upload their
times so the file can be refreshed.

The db2 job (one runner, ~21 min) now runs on a PR only when a changed file is an input of the five Db2 files:
their import closure (ast, computed by the planner), the equivalence cases they name, shared harness data, a
non-Python file under gitgalaxy/, or the job's own files. Replay of the last 80 merged PRs: 21 runs instead of
45. Push, nightly and manual runs run everything; Main Watch now watches Equivalence E2E.

Also drops the temporary junit-upload measurement steps.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 25, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 25, 2026 20:40
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #6669 @ 02ba96f: 1 failed check(s)

== full-suite part 2/3 (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/40228340467/job/121281685328
repro: python -m pytest -q tests/test_source_reads.py::test_no_source_read_loses_a_byte
failing tests: tests/test_source_reads.py::test_no_source_read_loses_a_byte
errors:
fail-on-cache-miss: false
E AssertionError: #3813: decode through gitgalaxy.core.source_text (read_source / open_source / decode_bytes) instead of a lossy errors= handler or a text-mode read of an estate file:
tests/test_source_reads.py:146: AssertionError
FAILED tests/test_source_reads.py::test_no_source_read_loses_a_byte - AssertionError: #3813: decode through gitgalaxy.core.source_text (read_source / open_source / decode_bytes) instead of a lossy errors= handler or a text-mode read of an e
##[error]Process completed with exit code 1.
log tail:
env:
PYTHONUTF8: 1
GITGALAXY_LICENSE_KEY: COMMUNITY_FREE_TIER
OMP_NUM_THREADS: 1
pythonLocation: /opt/hostedtoolcache/Python/3.12.15/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib
PYTEST_ADDOPTS: --ignore=tests/cobol_mainframe
##[endgroup]
With the provided path, there will be 1 file uploaded
Artifact name is valid!
Root directory input is valid!
Uploading artifact: test-times-part-2.zip
Beginning upload of artifact content to blob storage
Uploaded bytes 216914
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is 692e61636016f8d4a15d98395b5cb6abfa15e98918a3c94b384148960d05e31f
Finalizing artifact upload
Artifact test-times-part-2 successfully finalized. Artifact ID 12612798755
Artifact test-times-part-2 has been successfully uploaded! Final size is 216914 bytes. Artifact ID is 12612798755
Artifact download URL: https://github.com/squid-protocol/gitgalaxy/actions/runs/40228340467/artifacts/12612798755
Post job cleanup.
[command]/usr/bin/git version
git version 2.55.0
Temporarily overriding HOME='/home/runner/work/_temp/fdcf6c61-d798-4579-9c3d-b267a51b084f' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

@squid-shepherd squid-shepherd Bot added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 25, 2026
…3813 lint)

test_source_reads.py forbids lossy errors= decodes; the selector runs after the install, so it reads through
gitgalaxy.core.source_text like the #5954 guard. Selection unchanged (same 84 files).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@squid-shepherd squid-shepherd Bot removed the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 25, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (9e5bafe) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then).

@squid-shepherd
squid-shepherd Bot disabled auto-merge October 25, 2026 20:51
@squid-shepherd squid-shepherd Bot added shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md and removed shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md labels Oct 25, 2026
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 25, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit 92bb944 into main Oct 25, 2026
50 checks passed
@squid-shepherd squid-shepherd Bot removed the shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md label Oct 25, 2026
@squid-shepherd
squid-shepherd Bot deleted the worktree-equivalence-e2e-dedupe branch October 25, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Equivalence E2E: stop re-running ground-truth's tests in the shards; plan the db2 job from its inputs

1 participant