Skip to content

feat(track-p): role out-of-band 2-channel carrier - #45

Merged
electron-rare merged 2 commits into
masterfrom
feat/role-2channel-multiplexer
May 30, 2026
Merged

feat(track-p): role out-of-band 2-channel carrier#45
electron-rare merged 2 commits into
masterfrom
feat/role-2channel-multiplexer

Conversation

@electron-rare

Copy link
Copy Markdown
Collaborator

Implements the deferred role channel of GammaThetaMultiplexer.forward (issue #1 Q5).

When role is provided, forward returns a [B, 2, T] carrier:

  • channel 0 is byte-identical to the role=None carrier (additive / out-of-band, so the full 64-code alphabet is preserved);
  • channel 1 carries the role: PREDICTION on the gamma band (rFFT bin 7), ERROR on the theta band (bin 1), per nerve_core.neuroletter Role/Phase.

Q5 arbitration resolved to out-of-band (not an in-band 32/32 alphabet split).

Tests: replaced the NotImplementedError test with four tests (2-channel shape, channel-0 invariance, role/codes shape validation, gamma/theta spectral separability). 24 multiplexer tests + full fast suite (531 passed) green; ruff + mypy clean.

Implement the role channel of GammaThetaMultiplexer.forward: when role is
given, return a [B, 2, T] carrier. Channel 0 stays byte-identical to the
role=None carrier (additive/out-of-band, preserving the full 64-code
alphabet); channel 1 carries PREDICTION on the gamma band and ERROR on the
theta band per nerve_core.neuroletter Role/Phase. Resolves the deferred
issue #1 Q5 hook. Replace the NotImplementedError test with four tests
(2-channel shape, channel-0 invariance, shape validation, gamma/theta
spectral separability).
Copilot AI review requested due to automatic review settings May 28, 2026 03:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements the previously-deferred role channel in GammaThetaMultiplexer.forward. When role is supplied, forward now returns a [B, 2, T] carrier where channel 0 is byte-identical to the role=None output (preserving the full 64-code alphabet) and channel 1 carries the role: PREDICTION energy on the γ band (rFFT bin 7), ERROR on the θ band (bin 1), matching nerve_core.neuroletter.Role/Phase. The NotImplementedError is replaced with a ValueError for role/codes shape mismatch.

Changes:

  • Replace NotImplementedError in forward with shape validation and a real role-carrier branch that returns a stacked [B, 2, T] tensor.
  • Build the role channel as (1 - role) * gauss * γ_i + role * gauss * cos(2π·θ·t), modulated by the same θ envelope and (optionally) the same noise model.
  • Update the multiplexer tests: drop the raises NotImplementedError test and add four tests (2-channel shape, channel-0 invariance, role/codes shape validation, γ/θ spectral separability).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
track_p/multiplexer.py Adds out-of-band role channel generation and shape validation; updates docstring.
tests/unit/test_multiplexer.py Replaces deferred-role test with four tests for shape, channel-0 invariance, validation, and γ/θ separability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- forward(): fail-fast ValueError when role tensor contains values
  outside {0, 1} (PREDICTION/ERROR), with unique-values diagnostic.
  Guard placed after the existing shape check, where role is
  guaranteed non-None.
- demodulate(): raise ValueError with actionable hint (pass carrier[:,0])
  when a 3-D [B, 2, T] carrier is passed; role-channel decoding is
  not yet supported.
- Tests: add test_role_channel_zero_unchanged_under_noise (same RNG seed
  on both forward calls) and test_forward_raises_on_invalid_role_values.
  26/26 unit tests pass; 50/50 multiplex+gate_w non-regression pass.
@electron-rare
electron-rare merged commit 3823145 into master May 30, 2026
1 check passed
@electron-rare
electron-rare deleted the feat/role-2channel-multiplexer branch May 30, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants