fix(sprint-12/wave-F): codex P2 — AttentionMaskBackend impl for Atten…#394
Merged
Conversation
…tionMaskSoA + canonical MailboxId import Codex P2 review on PR #388 flagged that `AttentionMaskActor` is public but `AttentionMaskSoA` (the only production backend in the crate) doesn't implement `AttentionMaskBackend`. Downstream consumers can't add the impl themselves because they own neither the trait nor the SoA (Rust orphan rules), so `AttentionMaskActor::new(AttentionMaskSoA::new(...))` would force them to wrap in a local newtype. Fix #1 — production-backend impl in attention_mask_actor.rs Added `impl AttentionMaskBackend for crate::attention_mask::AttentionMaskSoA` with the four trait methods delegating to the existing inherent methods on AttentionMaskSoA. Now downstream consumers can wire the two directly: `AttentionMaskActor::new(AttentionMaskSoA::new(4))` works out of the box. Fix #2 — collapses CSI-10 from the W-Meta-Opus honest review The W-F2 worker had defined a local `pub type MailboxId = u32` in attention_mask.rs (Opus CSI-10 entry: "W-F2 used local MailboxId shadow alias"). Switched to `pub use lance_graph_contract::collapse_gate::MailboxId;` — same underlying u32 so all method signatures stay compatible, but now both attention_mask.rs and attention_mask_actor.rs reference the SAME canonical type and the trait impl in fix #1 can be added without type-mismatch concerns. Test status: 14/14 attention_mask + attention_mask_actor tests pass. Clean compile (modulo 2 pre-existing unused_mut warnings unrelated to this change). Branch rebased on main (post PR #385 merge) to pick up the ndarray hpc-extras feature flag that W-C1 added; this resolves the blake3 unresolved-crate compile failure that hit cognitive-shader-driver prior to rebase. https://claude.ai/code/session_01UwJuKqP828qyX1VkLgGJFS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…tionMaskSoA + canonical MailboxId import
Codex P2 review on PR #388 flagged that
AttentionMaskActoris public butAttentionMaskSoA(the only production backend in the crate) doesn't implementAttentionMaskBackend. Downstream consumers can't add the impl themselves because they own neither the trait nor the SoA (Rust orphan rules), soAttentionMaskActor::new(AttentionMaskSoA::new(...))would force them to wrap in a local newtype.Fix #1 — production-backend impl in attention_mask_actor.rs Added
impl AttentionMaskBackend for crate::attention_mask::AttentionMaskSoAwith the four trait methods delegating to the existing inherent methods on AttentionMaskSoA. Now downstream consumers can wire the two directly:AttentionMaskActor::new(AttentionMaskSoA::new(4))works out of the box.Fix #2 — collapses CSI-10 from the W-Meta-Opus honest review The W-F2 worker had defined a local
pub type MailboxId = u32in attention_mask.rs (Opus CSI-10 entry: "W-F2 used local MailboxId shadow alias"). Switched topub use lance_graph_contract::collapse_gate::MailboxId;— same underlying u32 so all method signatures stay compatible, but now both attention_mask.rs and attention_mask_actor.rs reference the SAME canonical type and the trait impl in fix #1 can be added without type-mismatch concerns.Test status: 14/14 attention_mask + attention_mask_actor tests pass. Clean compile (modulo 2 pre-existing unused_mut warnings unrelated to this change).
Branch rebased on main (post PR #385 merge) to pick up the ndarray hpc-extras feature flag that W-C1 added; this resolves the blake3 unresolved-crate compile failure that hit cognitive-shader-driver prior to rebase.
https://claude.ai/code/session_01UwJuKqP828qyX1VkLgGJFS