Skip to content

fix(mir): preserve imported owned return provenance#41

Merged
cuzzo merged 8 commits into
masterfrom
hotfix-brnfk-byte-list-leak
May 9, 2026
Merged

fix(mir): preserve imported owned return provenance#41
cuzzo merged 8 commits into
masterfrom
hotfix-brnfk-byte-list-leak

Conversation

@cuzzo
Copy link
Copy Markdown
Owner

@cuzzo cuzzo commented May 9, 2026

Summary

  • resync FunctionSignature metadata after MIR escape analysis so imported heap-returning callees keep return_provenance
  • require owned-return MIR bindings to expose AllocMark plus Cleanup/ErrCleanup/TransferMark, making missing ownership edges checker-visible
  • add regression coverage for returned list cleanup, including imported helper calls
  • fix range toList heap provenance and tolerate existing doctor heap-profile heading drift in spec

Verification

  • ./clear test transpile-tests/ -> 543 passed, 543 total; MEMORY LEAKS: 0
  • bundle exec rspec spec/ -> 4690 examples, 0 failures

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

🐰 Bencher Report

Branchhotfix-brnfk-byte-list-leak
Testbedubuntu-latest

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
Benchmarkleak-build-msMeasure (units) x 1e3leak-countMeasure (units)leak-run-msMeasure (units)
benchmarks/concurrent/04_fanout_fanin/bench📈 view plot
⚠️ NO THRESHOLD
6.01 units x 1e3📈 view plot
⚠️ NO THRESHOLD
0.00 units📈 view plot
⚠️ NO THRESHOLD
3,562.16 units
benchmarks/concurrent/09_kvstore/bench📈 view plot
⚠️ NO THRESHOLD
5.34 units x 1e3📈 view plot
⚠️ NO THRESHOLD
0.00 units📈 view plot
⚠️ NO THRESHOLD
60,004.09 units
benchmarks/concurrent/14_nested_lock/bench📈 view plot
⚠️ NO THRESHOLD
5.22 units x 1e3📈 view plot
⚠️ NO THRESHOLD
0.00 units📈 view plot
⚠️ NO THRESHOLD
415.34 units
benchmarks/inter-clear/02_concurrent_fsm_vs_stackful/bench_fsm📈 view plot
⚠️ NO THRESHOLD
5.21 units x 1e3📈 view plot
⚠️ NO THRESHOLD
0.00 units📈 view plot
⚠️ NO THRESHOLD
162.12 units
benchmarks/inter-clear/02_concurrent_fsm_vs_stackful/bench_stackful📈 view plot
⚠️ NO THRESHOLD
5.11 units x 1e3📈 view plot
⚠️ NO THRESHOLD
0.00 units📈 view plot
⚠️ NO THRESHOLD
310.73 units
benchmarks/sequential/11_pipeline_overhead/bench📈 view plot
⚠️ NO THRESHOLD
5.12 units x 1e3📈 view plot
⚠️ NO THRESHOLD
0.00 units📈 view plot
⚠️ NO THRESHOLD
14,015.69 units
🐰 View full continuous benchmarking report in Bencher

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 9, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 99.21875% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.11%. Comparing base (08b4c61) to head (96ca8a2).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
src/annotator-helpers/function_signature.rb 94.73% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #41      +/-   ##
==========================================
+ Coverage   90.09%   90.11%   +0.01%     
==========================================
  Files         185      185              
  Lines       49984    50079      +95     
  Branches    11984    12032      +48     
==========================================
+ Hits        45035    45128      +93     
- Misses       4949     4951       +2     
Flag Coverage Δ
ruby 86.81% <99.21%> (+0.05%) ⬆️
zig 95.91% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cuzzo cuzzo merged commit 95e77ac into master May 9, 2026
34 checks passed
cuzzo added a commit that referenced this pull request May 19, 2026
… drift

Add dynamic-array (#39) and nested Int64[][]@list (#40) shapes to
the move-modality x owning-shape matrix; both fail their GIVE
baseline (proven: `[]i64` vs `array_list.Aligned`; `*T` vs
`*const T`) so all their give/bare/copy cells are :in_dev gated by
#39/#40. list/set/pool/map unchanged (give :pass, bare/copy :in_dev
gated by #37). 18 cells, in_dev=14, 4 give run 0 fail/leak.

Coverage-integrity drift (#41) -- why the class went undetected:
surface_registry access_gate baseline claims escape_sinks
takes_arg/give_arg, true only for a struct (Counter); the taxonomy
not crossing sink x shape made the reporter mark the whole
takes/give surface covered, masking the collection-shape gap.
Register takes_move_modality in TEMPLATE_COVERAGE as the truthful
owner of takes_arg/give_arg across collection shapes; delete the
dead `when :takes_arg,:give_arg` branch in ownership_surface_smoke
(no cell ever had that sink -- unreachable; verified the template's
cell count/result is unchanged by the removal). Document the new
template in README so coverage.rb stays green.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
cuzzo added a commit that referenced this pull request May 20, 2026
…#41)

A sink-only TEMPLATE_COVERAGE claim (e.g. access_gate declaring
escape_sinks: [:takes_arg, ...] when the only cell uses a struct
Counter) made coverage.rb mark the entire takes/give surface
covered, masking the collection-shape gap that hid #37/#39/#40/#42.

SINK_REQUIRES_SHAPES declares per-sink required shape sets. For
each cross-cut sink (takes_arg, give_arg, return_value,
struct_field_store, list_append), coverage.rb unions
cleanup_value_shapes across every template whose escape_sinks
includes that sink, and reports any required shape missing.
templates_covering_sink helper enumerates them.

Schema additions:
- takes_move_modality now declares cleanup_value_shapes alongside
  collection_shapes (heap_list / set / pool / hash_map /
  dynamic_array -- the shapes it actually exercises).
- access_gate declares cleanup_value_shapes: [:struct_owned_fields]
  (the Counter cell shape).

The check surfaces #43: no template covers union_owned_payload
for takes_arg/give_arg (real gap -- a union-with-owned-payload
TAKES is the next #37-class blind spot, now visible). The other
sinks (return_value/struct_field_store/list_append) report clean
because ownership_surface_smoke's full cleanup_value_shapes list
combined with its escape_sinks claim already satisfies them.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
cuzzo added a commit that referenced this pull request May 20, 2026
… drift

Add dynamic-array (#39) and nested Int64[][]@list (#40) shapes to
the move-modality x owning-shape matrix; both fail their GIVE
baseline (proven: `[]i64` vs `array_list.Aligned`; `*T` vs
`*const T`) so all their give/bare/copy cells are :in_dev gated by
#39/#40. list/set/pool/map unchanged (give :pass, bare/copy :in_dev
gated by #37). 18 cells, in_dev=14, 4 give run 0 fail/leak.

Coverage-integrity drift (#41) -- why the class went undetected:
surface_registry access_gate baseline claims escape_sinks
takes_arg/give_arg, true only for a struct (Counter); the taxonomy
not crossing sink x shape made the reporter mark the whole
takes/give surface covered, masking the collection-shape gap.
Register takes_move_modality in TEMPLATE_COVERAGE as the truthful
owner of takes_arg/give_arg across collection shapes; delete the
dead `when :takes_arg,:give_arg` branch in ownership_surface_smoke
(no cell ever had that sink -- unreachable; verified the template's
cell count/result is unchanged by the removal). Document the new
template in README so coverage.rb stays green.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
cuzzo added a commit that referenced this pull request May 20, 2026
…#41)

A sink-only TEMPLATE_COVERAGE claim (e.g. access_gate declaring
escape_sinks: [:takes_arg, ...] when the only cell uses a struct
Counter) made coverage.rb mark the entire takes/give surface
covered, masking the collection-shape gap that hid #37/#39/#40/#42.

SINK_REQUIRES_SHAPES declares per-sink required shape sets. For
each cross-cut sink (takes_arg, give_arg, return_value,
struct_field_store, list_append), coverage.rb unions
cleanup_value_shapes across every template whose escape_sinks
includes that sink, and reports any required shape missing.
templates_covering_sink helper enumerates them.

Schema additions:
- takes_move_modality now declares cleanup_value_shapes alongside
  collection_shapes (heap_list / set / pool / hash_map /
  dynamic_array -- the shapes it actually exercises).
- access_gate declares cleanup_value_shapes: [:struct_owned_fields]
  (the Counter cell shape).

The check surfaces #43: no template covers union_owned_payload
for takes_arg/give_arg (real gap -- a union-with-owned-payload
TAKES is the next #37-class blind spot, now visible). The other
sinks (return_value/struct_field_store/list_append) report clean
because ownership_surface_smoke's full cleanup_value_shapes list
combined with its escape_sinks claim already satisfies them.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants