Refactor: remove dead gm_heap_ptr_ and slot_states_ptr_ from trb Runtime#1224
Conversation
Follow-up cleanup to hw-native-sys#1216. Two runtime fields were carried but never read: - `slot_states_ptr_` (in the device-copied `dev` descriptor): only ever written nullptr (ctor + one aicpu_executor site) and never read anywhere. Removed the field, its setter, and the nullptr-write call site. Since `dev` is alignas(64), the sizeof%64==0 static_assert still holds. - `gm_heap_ptr_` (host-only tail): written via set_gm_heap in runtime_maker but never read — the GM heap buffer is owned by DeviceRunnerBase's gm_heap_arena_ and released in finalize(), independent of this field (runtime_maker keeps the local StaticArenaPtrs::gm_heap that feeds init_data_from_layout). Removed the field, its getter/setter, and the set_gm_heap call site; the acquire_pooled_gm_heap() acquisition stays. Both arches (a2a3 + a5) lockstep. hbg is untouched (it has its own Runtime and never referenced these trb accessors). Verified: a2a3+a5 sim+onboard builds (trb+hbg); a2a3sim prepared_callable + dummy_task + orch_so_cache; a2a3 onboard prepared_callable + dummy_task + mixed_example. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
💤 Files with no reviewable changes (8)
📝 WalkthroughWalkthroughThis change removes slot-states pointer and GM heap pointer state from the Runtime class in both a2a3 and a5 runtime variants. The DeviceRuntimeLaunchDesc struct drops slot_states_ptr_, Runtime drops gm_heap_ptr_ and their associated accessor/mutator methods, and corresponding call sites in executor and runtime-maker code are removed. Runtime State Field Removal
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Follow-up cleanup to #1216. Two
Runtimefields in the tensormap_and_ringbuffer runtime were carried but never read — remove them (both arches, lockstep).slot_states_ptr_(in the device-copieddevdescriptor): only ever writtennullptr(ctor + oneaicpu_executorsite) and never read anywhere. Removed the field, its setter, and the nullptr-write call site.devisalignas(64), so thesizeof % 64 == 0static_assert still holds.gm_heap_ptr_(host-only tail): written viaset_gm_heapinruntime_makerbut never read. The GM-heap buffer is owned byDeviceRunnerBase::gm_heap_arena_and released infinalize(), independent of this field —runtime_makerkeeps the localStaticArenaPtrs::gm_heapthat feedsinit_data_from_layout, so theacquire_pooled_gm_heap()acquisition stays. Removed the field, its getter/setter, and theset_gm_heapcall site.host_build_graphis untouched (it has its ownRuntimeand never referenced these trb accessors); the shared platform layer never called them either.Testing
prepared_callable+dummy_task+orch_so_cache(9 passed)prepared_callable+dummy_task+mixed_example(9 passed)sizeof % 64 == 0/is_trivially_copyable_vstatic_asserts still hold)