Skip to content

typed_f64_receiver_method_clone_raw_loads_after_composed_guards: the guard-failure edge no longer calls $generic — miscompile or intentional collapse? #7506

Description

@proggeramlug

Split out of #7493, whose sweep listed this test among the failures PERRY_RS4GC=0 heals. It does not. Run alone it fails under both lowerings:

$ cargo test -p perry-codegen --test native_proof_regressions \
    typed_f64_receiver_method_clone_raw_loads_after_composed_guards -- --exact
thread '…' panicked at crates/perry-codegen/tests/native_proof_regressions.rs:11750:
receiver field or numeric arg guard failure should call the generic method body:
define double @perry_fn_typed_f64_receiver_method_ts__probe(double %arg1, double %arg2) alwaysinline {

$ PERRY_RS4GC=0 cargo test … -- --exact      # identical failure

The earlier "healed by PERRY_RS4GC=0" reading came from a whole-suite --test-threads=1 run, so it was an ordering artifact, not a lowering effect. #7493 therefore leaves this test deliberately unpinned, with a comment saying so, and hands it here.

The failing assertion

assert!(
    caller_ir.contains(&format!("call double @{generic_body}(")),
    "receiver field or numeric arg guard failure should call the generic method body:\n{caller_ir}"
);

The earlier assertions in the same test still pass — the caller does emit the method-direct guard, the raw-f64 field guard and the $typed_f64_recv call, in that order. What is missing is the $generic call on the guard-failure edge. The test's next assertion (a js_native_call_method_by_id fallback for method-direct guard failure) is not reached.

What needs deciding

Same question as #7494's four, and it has to be answered before touching the test:

  • If the guard-failure edge legitimately changed — e.g. the receiver-field guard now shares the method-direct guard's fallback, so one dynamic call covers both — then the assertion is stale and should be re-pointed at the property (every guard-failure edge reaches a correct dynamic path), not at the presence of one symbol. fix(test): isolate typed_feedback failures — a poisoned ENV_LOCK turned one failure into five (#7490) #7492's class-field rewrite is the worked example: it replaced a positional window with an end-to-end data-flow assertion.
  • If it did not, a guard-failure edge that no longer reaches the generic body is a miscompile: a receiver whose fields are not raw f64 would take the typed clone's raw loads anyway.

The test's own doc comment ("receiver clone must run only after method-direct and raw-f64 field guards") says the guards compose; check whether the composition still has three outcomes or has been collapsed to two.

Repro

cargo test -p perry-codegen --test native_proof_regressions \
  typed_f64_receiver_method_clone_raw_loads_after_composed_guards -- --exact --nocapture

Sibling lowering-independent failures: #7494 (four of them), #7503, #7504, #7505.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed defect or regression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions