fix: address Phase 2 code review feedback master
CRITICAL FIXES: 1. Fix stale presence bits on frame reallocation (emu/pe.py) - ALLOC path now resets presence[frame_id] and port_store[frame_id] - Prevents stale match state from persisting after FREE→re-ALLOC 2. Fix spurious token delivery on switch ops in _emit_inherit - Restructured to check for switch ops BEFORE emitting dest_l - Eliminates ability to spawn uncancellable _deliver processes - Switch ops now emit both outputs atomically based on bool_out IMPORTANT ADDITIONS: 1. Add AC3.10 timing tests (TestPipelineTiming) - Verify dyadic tokens: 5 cycles - Verify monadic tokens: 4 cycles - Verify side paths: 2 cycles 2. Add tests for dual-dest INHERIT and switch ops (TestDualDestInherit, TestSwitchOps) - Test dest_count=2 non-switch paths - Test SWEQ with bool_out=True and bool_out=False routing 3. Add GATE suppression tests (TestGateSuppression) - Verify suppression when bool_out=False - Verify output when bool_out=True 4. Add SM dispatch tests (TestSMDispatch) - Test SM token construction with return routes - Verify target, addr, op, and ret fields MINOR FIXES: 1. Fix _deliver type annotation (emu/pe.py) - Changed parameter type from PEToken to no type hint - SMToken is also delivered and inherits from Token, not PEToken 2. Fix dead code in const_val handling (emu/pe.py) - Removed no-op self-assignment - Restructured to: if not isinstance(const_val, int): const_val = None 3. Add TokenRejected for invalid act_id in PELocalWriteToken (emu/pe.py) - region=1 frame write now emits TokenRejected on invalid act_id - Consistent with other invalid input paths