Repository navigation
test: element identity may add only the facts keyed by element_offset (cargo-test red since #14354) - #14598
test: element identity may add only the facts keyed by element_offset (cargo-test red since #14354)#14598raliclo wants to merge 3 commits into
Conversation
product_element_identity_preserves_codegen_facts (c0d6cb8) asserts that the elision facts are identical with and without element source identity. PerryTS#14354 (59925ca) added `number_element_reads` and PerryTS#14537 added `primitive_elements`, both keyed by `element_offset`, where 0 means "no identity", so those facts exist only when identity does and the test has failed on main since 59925ca (found by bisect from c0d6cb8). The test now asserts that the two facts are empty without identity and that every other elision fact is unchanged once they are set aside. Sites, solver stats and the facts digest are still compared whole. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
|
Superseded by 398e5b4 on |
Summary
cargo-testfails on every PR atprogram_facts::element_tests::product_element_identity_preserves_codegen_facts. The test (c0d6cb8) asserts that the elision facts are identical with and without element source identity. #14354 (59925ca) addednumber_element_readsand #14537 addedprimitive_elements; both are keyed byelement_offset, where 0 means "no identity", so they can exist only when identity does.git bisectfrom c0d6cb8 (good) names 59925ca as the first bad commit.This PR keeps the test's intent and makes it precise: identity may add those two facts and nothing else.
Changes
crates/perry/src/commands/compile/program_facts/element_tests.rs: assertnumber_element_readsandprimitive_elementsare empty without identity, then compare every other elision fact after clearing those two.sites, solver stats anddigest_forare still compared whole (they were already equal).Related issue
Introduced by #14354 / 59925ca (bisect), extended by #14537.
If the intended invariant is the stricter one — identity must not add any elision — then the fix belongs in those two facts instead, and this PR is the wrong one; happy to close it in that case.
Test plan
Base
6dfb4af3aa(currentmain).maincargo test --release -p perry --bin perry product_element_identity_preserves_codegen_factsassert_eq!(onlynumber_element_reads: {75: false}andprimitive_elements: {75}differ)cargo test --release -p perry --bin perry program_factsliteral_string_locals)Bisect:
git bisect runwith that single test between c0d6cb8 (good) and 91a26fd~1 (bad), 9 steps, no skips.Built on macOS (Apple M6), nightly from
rust-toolchain.toml, LLVM 23.1.5.Test-only change; a
changelog.dfragment is included because the path is undercrates/and I cannot set theskip-changeloglabel — drop it if you label the PR instead.Checklist
feat:/fix:/docs:/chore:prefix convention used in the log🤖 Generated with Claude Code
https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
Summary by CodeRabbit