braintools.cogtask.execute_phase_packed

braintools.cogtask.execute_phase_packed#

braintools.cogtask.execute_phase_packed(phase, ctx)[source]#

Variable-length / packed-mode dispatch for a single phase.

Unlike execute_phase() the phase’s actual length is a traced int32 scalar; the buffer slot reserved for it is sized by the Python-int max_steps. Leaf phases are run against a phase-local block of shape (max_dur, …), the block is gated to zero for positions beyond the traced actual length, and the block is then written into the trial-level buffers at ctx.t_cursor via jax.lax.dynamic_update_slice. Compound phases dispatch to their own execute_packed implementation; the runtime swap/gate/write happens at each leaf.

Return type:

None