Skip to content

fix(runtime): restore function names for migrated async guards#147

Merged
rocketman-code merged 1 commit intomainfrom
fix/migrated-fn-names
Feb 27, 2026
Merged

fix(runtime): restore function names for migrated async guards#147
rocketman-code merged 1 commit intomainfrom
fix/migrated-fn-names

Conversation

@rocketman-code
Copy link
Owner

Summary

  • Add a global interned string table mapping u16 IDs to function names, with a thread-local cache on the hot path
  • Restructure Guard's packed field from [cookie:48][depth:16] to [cookie:32][name_id:16][depth:16], keeping Guard at exactly 16 bytes
  • On migrated drop, look up the real function name from the intern table instead of using ""

Closes #116

Test plan

  • New test migrated_guard_preserves_function_name asserts migrated records have real function names
  • New test migrated_guards_distinguish_multiple_functions asserts multiple migrating functions stay distinct
  • New test migrated_invocation_has_real_name asserts InvocationRecord carries real name
  • Updated 6 existing migration tests to expect real names instead of ""
  • Updated async_self_time e2e test to assert no "" bucket
  • All workspace tests pass (129 unit + 22 integration)
  • Clippy clean, fmt clean, docs build clean
  • Guard size verified: still exactly 16 bytes (compile-time transmute assertion)

rocketman-code added a commit that referenced this pull request Feb 27, 2026
- Document cookie truncation to 32 bits in pack_cookie_name_depth
- Add runtime guard for u16 overflow in intern_name_slow
- Add boundary values to pack_unpack_round_trip test
Add a global interned string table mapping u16 IDs to function names,
with a thread-local cache on the hot path. Restructure Guard's packed
field from [cookie:48][depth:16] to [cookie:32][name_id:16][depth:16],
keeping Guard at exactly 16 bytes. On migrated drop, look up the real
function name from the intern table instead of using "<migrated>".

Closes #116
@rocketman-code rocketman-code merged commit 8efab0d into main Feb 27, 2026
5 checks passed
@rocketman-code rocketman-code deleted the fix/migrated-fn-names branch February 27, 2026 18:25
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.

fix: restore function names for migrated async guards

1 participant