Tab drag: forward index decisions to Rust (migration shard 002)
TabMoveIndex now forwards all three index decisions to Rust through the existing public Swift signatures. A call-local dictionary assigns integer IDs using Swift String equality, preserving canonically equivalent Unicode and embedded NULs across every input buffer.
Leo’s request: “A Rosie-style migration harness for large code moves ... pick one Swift-logic-to-Rust move ... run it through the harness, and land the shards.”
This is shard 002 of the two-shard pilot. It stays on by default, preserves defined behavior, and can be rolled back by reverting this PR. The new parity suite compares against the original Swift bodies from 448f224569597f865aeeda2896f7d34a34215e4e, covering reordered and hidden tabs, duplicates, empty arrays, Unicode/NUL identity, group membership subsets, and extreme signed indices. The original Int.max increment trap is excluded from parity.
Depends on #34507 and the subsequent app-FFI pin. After both land, this branch must merge the current base before independent review. The migration owner runs the fixed build and parity gates and performs the merge.
Validation
- The pre-push static gate passes at 71aeefdfeab487a47faed101a5963a08834a8ff0.
- Source comparison confirms that the test oracle preserves the original policy bodies verbatim, changing only the helper name and visibility.
- Local syntax verification is unavailable because swiftc is not installed. The scoped preflight passes localization defaults and feature flags; workspace package grouping already fails on the planned base (missing CmuxDeviceHub entry). No unrelated files changed.
- Fleet app compile-check passed at exact head
9ed07234a434be2ce53f505fd36092edecd67b20(jobdd5c9e887cfd77c489b709aa). - Focused macOS parity suite
TabMoveIndexRustParityTestspassed at the exact head (fleet stepc2faad7f8ac29ccdd06d64f2).
Performance
These are policy ownership counts, measured by inspecting the same TabMoveIndex source before and after; they are not runtime latency measurements.
| Metric | Before | After | Delta | Harness or run link |
|---|---|---|---|---|
| Production Swift index decisions implemented locally | 3 | 0 | -3 | Same-source inspection at 448f224569597f865aeeda2896f7d34a34215e4e and 71aeefdfeab487a47faed101a5963a08834a8ff0 |
| Index decisions forwarded to Rust | 0 | 3 | +3 | Same-source inspection |
Migration throughput report: awaiting the migration owner’s supplied report link.
Prior art
Read the original wire conversion from #15555, the daemon matrix conversion from #20253, and the source-path group-index fix at 19700bafedc8f949d8c7da61ed50c4011fcc5091. The path has no newer changes in the last 14 days. Read #34507’s header, index implementation, and Bridge dependency change. The prior-art and overlap helpers hit the shared GitHub quota; the available overlap cache is partial and cannot establish complete current open-PR coverage.
Changelog
none
🤖 Generated with Codex
Agent session: agent session
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Forwards all three TabMoveIndex index decisions to Rust through the existing public Swift API. A call-local nonisolated string interner maps Swift String values to integer IDs, preserving canonical Unicode equivalence and embedded NULs without crossing the ABI. A parity suite compares against the original Swift bodies from the pre-move commit, covering reordered and hidden tabs, duplicates, empty arrays, Unicode/NUL identity, group membership subsets, and extreme signed indices; the Int.max increment trap case is excluded.
This is shard 002 of the migration pilot. It stays on by default and preserves defined behavior; reverting it restores the Swift implementations. It depends on the prerequisite PR and app-FFI pin, and the branch has merged the current feat-cmux-next base.
Validation
- Pre-push static gate passes; the migration owner's build and parity gates are pending.
Performance
- These are policy ownership counts, not runtime measurements: the three index decisions now forward to Rust instead of being implemented locally in Swift.