Skip to content

Commit 2692a09

Browse files
committed
docs(test): annotate expected impact for fallback case
1 parent e7d0459 commit 2692a09

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Expected Impact Notes: static-vtable-nonbuiltin-deref
2+
3+
This file marks the expected-output locations directly affected by the
4+
`GlobalAlloc::Static` / `GlobalAlloc::VTable` non-`builtin_deref` fallback fix.
5+
6+
## Impact 1: top-level alloc kinds are now present
7+
- Location in expected:
8+
- `tests/integration/programs/static-vtable-nonbuiltin-deref.smir.json.expected:2`
9+
- `tests/integration/programs/static-vtable-nonbuiltin-deref.smir.json.expected:5`
10+
- `tests/integration/programs/static-vtable-nonbuiltin-deref.smir.json.expected:10`
11+
- Before (pre-fix behavior):
12+
- The run panicked during alloc collection with:
13+
`Allocated pointer is not a built-in pointer type`
14+
(`src/printer.rs:789` on `origin/master` baseline).
15+
- So there was no valid `.smir.json`/`.expected` result for this case.
16+
- Now:
17+
- `allocs` contains both `Static` and `VTable` entries.
18+
- Why this is reasonable:
19+
- The test constant is a trait-object reference (`&dyn Debug`), which has
20+
both data provenance (to the static) and metadata provenance (to vtable).
21+
- Collecting both alloc kinds reflects actual MIR provenance shape.
22+
23+
## Impact 2: trait-object provenance pair is preserved instead of aborting
24+
- Location in expected:
25+
- `tests/integration/programs/static-vtable-nonbuiltin-deref.smir.json.expected:133`
26+
- `tests/integration/programs/static-vtable-nonbuiltin-deref.smir.json.expected:134`
27+
- `tests/integration/programs/static-vtable-nonbuiltin-deref.smir.json.expected:140`
28+
- Before (pre-fix behavior):
29+
- Traversal hit the assert path while following non-`builtin_deref` container
30+
provenance, aborting before full alloc graph serialization.
31+
- Now:
32+
- The serialized constant keeps two provenance pointers (offsets `0` and `8`)
33+
and serialization completes.
34+
- Why this is reasonable:
35+
- Fat-pointer layout for trait objects is `(data_ptr, vtable_ptr)`.
36+
- Offsets `0` and `8` are the expected two-pointer slots on 64-bit targets.
37+
38+
## Impact 3: deterministic golden normalization for unstable trait IDs
39+
- Location in expected pipeline:
40+
- `tests/integration/normalise-filter.jq:32`
41+
- Before:
42+
- Trait `def_id` values in this case are unstable across runs/environments,
43+
causing golden noise unrelated to the semantic bug.
44+
- Now:
45+
- Normalization drops `def_id` object fields before diffing expected.
46+
- Why this is reasonable:
47+
- The test intent is to validate successful static/vtable alloc recovery, not
48+
compiler-internal numeric IDs.

0 commit comments

Comments
 (0)