Skip to content

ci_e2e_scope: map crates/perry-codegen/src/** to the six in-process root-lowering suites (~6.5s) — blocked on them being green #7507

Closed

Description

@proggeramlug

Split out of #7493. The pin is fixed; the reason nobody noticed for weeks is not.

The gap

.github/workflows/test.yml's e2e-scoped job (via scripts/ci_e2e_scope.py) runs the integration suites a diff names:

changed crates/<pkg>/tests/<suite>.rs   ->   cargo test -p <pkg> --test <suite>

ci_e2e_scope.py deliberately refuses the source→suite direction, and says why: there is no coverage data to map it with, and a crate-level map (perry-codegen -> all 163 perry suites) is exactly the full run the scoping exists to avoid. That reasoning is right in general and wrong for one narrow case.

#7370 changed crates/perry-codegen/src/. It named no suite. shadow_slot_hygiene went 0/12 and nothing was red until someone ran the nightly tier by hand. The per-PR cargo-test gate is --lib --bins, so it saw none of it.

Why this particular set is the exception

The six root-lowering suites are not like the 163 perry suites the general rule is protecting against. They are in-process compiles of hand-built HIR with emit_ir_only: true — no perry compile subprocess, no link, no runtime. Measured (arm64 macOS, debug, --test-threads=1):

suite tests wall
shadow_slot_hygiene 12 0.17 s
scalar_replaced_slot_roots 11 0.18 s
temp_root_argument_temporaries 7 0.08 s
temp_root_operand_temporaries 19 0.39 s
native_proof_buffer_views 32 0.50 s
native_proof_regressions 255 5.13 s

~6.5 s of test time for all six. The cost is the build, which e2e-scoped already pays whenever any perry-codegen suite is in scope, on a warmed sccache.

Why this is NOT being done in #7493

A new gate has never been green. Fifteen tests across these suites are red right now for three causes #7493 does not own — #7494, #7503, #7504 (plus #7505 and #7506). Adding crates/perry-codegen/src/** -> these six suites today makes e2e-scoped red on the majority of perry-codegen PRs.

e2e-scoped is not in branch protection's required contexts, so that would not block merges — which is precisely what makes it dangerous rather than safe. A job that is red on most PRs and cannot block anything is CLAUDE.md hazard 2 with extra steps: reviewers learn to ignore it, and it can never be promoted, because promoting it would then block everything. Wiring it up before the suites are green would spend the one chance to make this signal mean something.

#7493 does add the one un-rot mechanism that can be green today:
codegen::testing_feature_gate_tests::host_target_lowering_default_is_native_roots, a unit test in src/ — so inside the REQUIRED cargo-test job — that fails the moment the root-lowering default flips again, naming the suites that then need re-pinning. That catches the specific #7370 shape at merge time. It does not catch a codegen change that regresses these suites for any other reason, which is what this issue is for.

What to build

  1. Add an explicit SOURCE_SUITE_MAP to scripts/ci_e2e_scope.py:
    SOURCE_SUITE_MAP = {
        "crates/perry-codegen/src/": [
            ("perry-codegen", "shadow_slot_hygiene"),
            ("perry-codegen", "scalar_replaced_slot_roots"),
            ("perry-codegen", "temp_root_argument_temporaries"),
            ("perry-codegen", "temp_root_operand_temporaries"),
            ("perry-codegen", "native_proof_regressions"),
            ("perry-codegen", "native_proof_buffer_views"),
        ],
    }
    Hand-maintained and narrow by design — the general refusal stands; this is one named exception with a stated cost. Six entries fits comfortably under DEFAULT_CAP = 12.
  2. Extend --self-test to cover it: a crates/perry-codegen/src/codegen/helpers.rs change must select exactly these six, and a change to any other crate's src/ must still select nothing.
  3. Cross-check the list against tests/ on disk, so a renamed or deleted suite fails the scope step instead of silently dropping out — the same "an entry that matches nothing FAILS" rule scripts/gc_root_dominance_allowlist.json uses.
  4. Run it once on a real PR, confirm green, and only then consider promotion.

Blocked on

#7494, #7503, #7504 green (and #7505, #7506 resolved or the tests they name re-pointed). Until then this mapping cannot land without normalising a red job.

Activity

  1. proggeramlug commented on Aug 9, 2026

    @proggeramlug
    ContributorAuthor

    Partially done in #7675 — this issue stays open, deliberately, for the two suites that are not green yet.

    Landed. SOURCE_SUITE_MAP is in scripts/ci_e2e_scope.py, with items 1–3 of the plan:

    SOURCE_SUITE_MAP = {
        "crates/perry-codegen/src/": [
            ("perry-codegen", "shadow_slot_hygiene"),
            ("perry-codegen", "scalar_replaced_slot_roots"),
            ("perry-codegen", "temp_root_operand_temporaries"),
        ],
    }
    • Cross-checked against tests/ on disk. _source_map_selection raises SystemExit if an entry names a suite with no crates/*/tests/<suite>.rs — an entry that matches nothing FAILS the scope step rather than silently selecting less, the gc_root_dominance_allowlist.json rule. The --self-test sabotages that both ways: once against a fixture tree (rename the suite away, require the raise) and once against the real repo (select([prefix + "probe.rs"], _repo_root()) at the end of the self-test, so a suite renamed in a future PR fails lint immediately).
    • --self-test extended with four cases: a crates/perry-codegen/src/codegen/helpers.rs-shaped change selects exactly the mapped suites; any other crate's src/ still selects nothing; a source change plus one of the crate's own suites is the deduplicated union; and the cross-check sabotage above. python3 scripts/ci_e2e_scope.py --self-test → ok.
    • Verified end to end: echo crates/perry-codegen/src/gc_map.rs | python3 scripts/ci_e2e_scope.py prints the three pairs, exit 0.

    Measured cost of the three, arm64 macOS, debug, --test-threads=1: 12 tests / 0.10 s, 11 / 0.12 s, 19 / 0.16 s. Under half a second; the cost is the build, which e2e-scoped already pays whenever any perry-codegen suite is in scope.

    Deliberately NOT listed: native_proof_regressions, native_proof_buffer_views.

    Both are now unpinned and correct with respect to #7505, but each still carries two pre-existing failures that are not this map's to fix:

    • native_proof_buffer_views: proven_buffer_and_typed_array_reads_are_numeric_operands, reassigned_typed_array_store_records_runtime_fallback
    • native_proof_regressions: integer_modulo::i32_counter_mod_unsafe_or_nonliteral_divisors_keep_frem, typed_f64_receiver_method_clone_raw_loads_after_composed_guards

    Verified pre-existing: the same four fail at pristine a853135aa with the tests/ tree checked out clean, and the same four (no more) fail after #7675. They are #7506's / #7494's neighbourhood, not #7503's or #7504's.

    This is exactly the reasoning in the issue body, so I have followed it rather than overridden it: a job that is red on most perry-codegen PRs and cannot block anything (e2e-scoped is not in branch protection) is hazard 2 with extra steps, and wiring it up early would spend the one chance to make this signal mean something. The map's comment names both suites and says to add them in the same commit that turns them green.

    Remaining for this issue:

    1. Fix or triage the four failures above.
    2. Add the two suites to SOURCE_SUITE_MAP in that commit (the self-test already covers the mechanism, so it is a two-line change plus a green run).
    3. Item 4 of the plan — run it once on a real PR, confirm green, and only then consider promotion.
  2. proggeramlug commented on Aug 10, 2026

    @proggeramlug
    ContributorAuthor

    Superseded by #7748, which takes SOURCE_SUITE_MAP's crates/perry-codegen/src/ entry from 3 suites to 22 — not the six named here.

    The premise that this was "blocked on them being green" turned out to be mostly stale. Re-measured on main at v0.5.1437, one cargo test -p perry-codegen --test <suite> per suite: 22 of the 24 suites in that crate are fully green, and every one runs in 2.2–10.4 s wall clock (nearly all of it cargo's freshness check — the test time is sub-second). 23 of the 24 are in-process emit_ir_only compiles, so the cost argument that scoped this to six never applied to the other seventeen either.

    The two that are still red are held out by failing test, not by suite, so native_proof_regressions contributes its other 261 tests instead of going dark for one — and the exclusions fail CI if the named test starts passing, so they cannot rot the way #797 describes.

    Closing as superseded once #7748 lands.

  3. proggeramlug commented on Aug 10, 2026

    @proggeramlug
    ContributorAuthor

    Superseded and closed by #7748 (merged): SOURCE_SUITE_MAP now maps crates/perry-codegen/src/ to 22 suites rather than the six requested here, --self-test fails on any perry-codegen/tests/*.rs that is neither mapped nor explicitly excluded, and the two still-red tests are held out per-TEST (so native_proof_regressions contributes its other 261) with a check that fails if a held-out test starts passing.

    The premise that this was blocked on greenness was mostly stale: 22 of the 24 suites were already green, and 23 of 24 are in-process emit_ir_only compiles running in 2.2–10.4 s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions