Skip to content
This repository was archived by the owner on Jun 4, 2026. It is now read-only.

Commit 6c121e4

Browse files
fantomx42claude
andcommitted
feat(fcas): resolve cross-cube interference semantics (CANON item #4)
Closes the last CANON open work item (§9 #4): what does it mean for a nested cube³:0 to interfere with its parent? Answer: it doesn't — the fractal address space is an orthogonal decomposition. expand_cube seeds children via sha256(portal_hash + face), which decorrelates every child from its parent, so a child cannot constructively or destructively interfere with it. - fcas.cross_cube_interference: operational definition, reusing the §4 three-grid interference taxonomy on the depth axis (parent→corpus, child→experiential, zero/open SCM so CONTESTED never fires). - scripts/bench/cross_cube_probe.py: characterization over the fixed corpus. Measured: mean |Pearson(parent,child)| = 0.013, below the 1/sqrt(4096)=0.016 independent-vector noise floor; GROUNDED observed 0.999 = null product 0.999 (co-peaking is attractor density, not structure). Verdict: orthogonal. - tests/test_cross_cube.py: determinism, valid states, CONTESTED==0, orthogonality bound. - CANON §6.4 documents the semantics; §6.3 + §9 item #4 -> done; all four open work items now closed. - README: open-work list, FCAS status/build table, eval status, and the benchmark CLI table refreshed. interference.py and all sacred files untouched. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 72a0e03 commit 6c121e4

6 files changed

Lines changed: 328 additions & 17 deletions

File tree

CANON.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,9 @@ Section number kept stable to preserve cross-references.
452452

453453
Fractal Cube Address Space. The core address layer is built in
454454
`wheeler_memory/fcas.py` (portal/cube primitives, deterministic address
455-
traversal + resolution, and a `recognize_address` bridge into the recall
456-
path). Cross-cube interference remains speculative; the 3D fractal-cube
457-
explorer is unbuilt.
455+
traversal + resolution, a `recognize_address` bridge into the recall
456+
path, and cross-cube interference semantics — §6.4). Only attractor
457+
identification remains partial; the 3D fractal-cube explorer is unbuilt.
458458

459459
## 6.1 Key structure
460460

@@ -480,7 +480,38 @@ which is also a new origin.
480480
- Attractor identification: `[PARTIAL]`
481481
- Address resolution: `[BUILT]``fcas.resolve` / `fcas.recognize_address`
482482
- Fractal nesting: `[BUILT]``fcas.portal_hash` / `expand_cube` / `traverse`
483-
- Cross-cube interference: `[SPECULATIVE]`
483+
- Cross-cube interference: `[BUILT]``fcas.cross_cube_interference` (§6.4)
484+
485+
## 6.4 Cross-cube interference semantics `[BUILT]`
486+
487+
What does it mean for a nested `cube³:0` to interfere with its parent?
488+
**Answer: it doesn't — the fractal address space is an orthogonal
489+
decomposition.** Because `expand_cube` seeds each child via
490+
`sha256(portal_hash(parent) + face)`, a cryptographic hash decorrelates
491+
every child from its parent by construction. A child cannot
492+
constructively (or destructively) interfere with its parent because the
493+
portal destroys the correlation that interference would require.
494+
495+
The depth axis reuses the §4 three-grid taxonomy — parent → corpus
496+
channel, child → experiential channel — with a **zero (fully open) SCM**,
497+
since there is no trust gate along depth; the closed-SCM CONTESTED state
498+
therefore never fires. Implemented in `fcas.cross_cube_interference`;
499+
characterized by `scripts/bench/cross_cube_probe.py`.
500+
501+
Measured over the fixed corpus (20 parents × 6 children = 120 pairs):
502+
503+
- **depth coherence** (mean `|Pearson(parent, child)|`) = **0.0134**,
504+
*below* the independent-vector noise floor `1/√4096 = 0.0156`. This is
505+
the decisive signal: children are statistically independent of parents.
506+
- **GROUNDED** observed `0.9992` = null expectation `0.9992`
507+
(`peak_rate_parent × peak_rate_child`, both ≈ 1.0). Near-total co-peaking
508+
reflects only attractor *density* (converged attractors saturate near
509+
±1 almost everywhere), not interference structure — and an exact match
510+
to the independence null confirms there is no extra structure to find.
511+
512+
Consequence for the model: nested cubes are independent subspaces. Depth
513+
in FCAS adds *new* orthogonal capacity rather than re-weighting the
514+
parent — the address hierarchy composes by extension, not by feedback.
484515

485516
---
486517

@@ -571,9 +602,13 @@ In priority order:
571602
[docs/corpus-population-strategy.md](docs/corpus-population-strategy.md),
572603
validated (§8.2). Follow-up: add an `embedding` encoder to
573604
`wheeler-mmlu` so it can score against an embedding-populated corpus.
574-
4. **Cross-cube interference semantics** — what does it mean for a
575-
nested cube³:0 to interfere with its parent? Now unblocked — FCAS
576-
resolution is done (§6.3) — but still speculative in design.
605+
4. ~~**Cross-cube interference semantics** — what does it mean for a
606+
nested cube³:0 to interfere with its parent?~~ `[DONE]` — it doesn't;
607+
the address space is an orthogonal decomposition (portal hash
608+
decorrelates child from parent). Measured in §6.4 via
609+
`fcas.cross_cube_interference` / `scripts/bench/cross_cube_probe.py`.
610+
611+
All open work items are closed. New items land below as they arise.
577612

578613
---
579614

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ All 57 subjects, 14,042 questions (test split):
184184

185185
Encoder: blended (hippocampus 0.7 + language wheeler 0.3). The L3 classifier is trained with numpy SGD (~11K params); loss barely moves from chance — needs more training data or richer features. Full logs in `results/`; recorded baselines in `results/BASELINES.md`. The previous MiniLM semantic baseline (27.5%) used an external pretrained model and is no longer the default encoder.
186186

187-
The right eval for an attractor-reconstruction memory is not a multiple-choice benchmark. Wheeler-native eval design — perturb a known attractor, measure settling time and final-state fidelity — is `[SPECULATIVE]` (canon §8.3).
187+
The right eval for an attractor-reconstruction memory is not a multiple-choice benchmark. Wheeler-native eval — perturb a known attractor, measure settling time and final-state fidelity — is `[BUILT]` as `wheeler-recon-bench` (canon §8.3). Baseline: mean fidelity ≈ 0.85, basin capture radius ≈ ε≤0.50.
188188

189189
### SimLex-999 `[ACTIVELY TRACKED]`
190190

@@ -242,6 +242,7 @@ All 16 commands registered in `pyproject.toml [project.scripts]`. Common flags:
242242
| `wheeler-scrub --text "text"` | Brick inspector — visualise how a memory formed |
243243
| `wheeler-info` | System info (hardware, GPU, paths) |
244244
| `wheeler-bench` | CA quality benchmark (lower is better) |
245+
| `wheeler-recon-bench` | Reconstruction-fidelity benchmark — basin capture radius (canon §8.3) |
245246
| `wheeler-bench-gpu` | CPU vs GPU evolution-speed benchmark |
246247
| `wheeler-generate` | Generative engine (IT-from-BIT mode) |
247248
| `wheeler-scm` | Inspect SCM trust topology |
@@ -329,18 +330,20 @@ The `wheeler-ui` CLI was retired in v0.3.6 (orphaned since March 2026); static d
329330

330331
## Open work
331332

332-
In priority order (canon §9):
333+
The four canon §9 work items are all closed:
333334

334-
1. **FCAS address resolution** `[DESIGNED]` — wire `(hash, depth)` tuple keys into the recall path. See FCAS section below.
335-
2. **Wheeler-native eval design** `[SPECULATIVE]` — reconstruction-fidelity benchmark to replace reliance on MMLU as architecture signal (perturb a known attractor, measure settling time and final-state fidelity).
336-
3. **Corpus population strategy** `[OPEN]` — what gets ingested, how it gets ternarized, how to budget across the grid. Affects MMLU directly.
337-
4. **Cross-cube interference semantics** `[SPECULATIVE]` — what does it mean for a nested cube³:0 to interfere with its parent? Speculative until FCAS resolution is done.
335+
1. **FCAS address resolution** `[DONE]``(hash, depth)` tuples wired into the recall path via `fcas.recognize_address` (canon §6).
336+
2. **Wheeler-native eval** `[DONE]` — reconstruction-fidelity benchmark `wheeler-recon-bench` (canon §8.3).
337+
3. **Corpus population strategy** `[DONE]` — strategy + proof in [docs/corpus-population-strategy.md](docs/corpus-population-strategy.md); populating the science corpus moved MMLU science 24%→32% and recall@1 0%→97% (canon §8.2).
338+
4. **Cross-cube interference semantics** `[DONE]` — resolved as an *orthogonal decomposition*: the portal hash decorrelates a nested cube³:0 from its parent, so they cannot interfere (canon §6.4).
339+
340+
Remaining non-blocking follow-ups: an `embedding` encoder for `wheeler-mmlu` (so it can score against an embedding-populated corpus), and the unbuilt 3D fractal-cube explorer.
338341

339342
---
340343

341344
## FCAS — Fractal Cube Address Space
342345

343-
`[DESIGNED]`. Hash primitives `[BUILT]`; address resolution and fractal nesting not yet wired.
346+
`[PARTIAL]`. Core address layer is built in `wheeler_memory/fcas.py` (portal/cube primitives, deterministic traversal + resolution, `recognize_address` recall bridge, and cross-cube interference semantics). Only attractor identification remains partial.
344347

345348
Addresses are tuples `(hash, depth)`. The SHA256 of a terminal attractor serves *simultaneously* as:
346349

@@ -356,9 +359,9 @@ Build status (canon §6.3):
356359
|---|---|
357360
| Hash primitives | `[BUILT]` |
358361
| Attractor identification | `[PARTIAL]` |
359-
| Address resolution | `[DESIGNED]` |
360-
| Fractal nesting | `[DESIGNED]` |
361-
| Cross-cube interference | `[SPECULATIVE]` |
362+
| Address resolution | `[BUILT]` |
363+
| Fractal nesting | `[BUILT]` |
364+
| Cross-cube interference | `[BUILT]` — orthogonal decomposition (§6.4) |
362365

363366
---
364367

scripts/bench/cross_cube_probe.py

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
"""Cross-cube interference probe (CANON open item #4, §6.4).
2+
3+
Characterizes what it means for a nested cube³:0 to interfere with its parent.
4+
For each parent attractor we spawn its 6 children through the FCAS portal and
5+
measure, via fcas.cross_cube_interference, two things:
6+
7+
1. depth coherence — mean |Pearson(parent, child)| across all parent×face
8+
pairs. Because expand_cube seeds children with sha256(portal_hash + face),
9+
children are decorrelated from the parent by construction, so this should
10+
sit at the noise floor for two independent length-4096 vectors, ≈ 1/√4096
11+
≈ 0.0156. That is the decisive orthogonality test.
12+
2. GROUNDED fraction vs the null expectation parent_peak_rate ×
13+
child_peak_rate. Converged attractors are dense (peak almost everywhere),
14+
so both observed GROUNDED and the null product land near 1.0 — co-peaking
15+
reflects attractor density, not interference structure, and is *also*
16+
consistent with independence.
17+
18+
Conclusion the numbers support: the fractal address space is an orthogonal
19+
decomposition — a child cannot constructively interfere with its parent.
20+
21+
Usage
22+
-----
23+
python scripts/bench/cross_cube_probe.py
24+
python scripts/bench/cross_cube_probe.py --json
25+
"""
26+
27+
from __future__ import annotations
28+
29+
import argparse
30+
import json
31+
32+
import numpy as np
33+
34+
from wheeler_memory.constants import INTERFERENCE_PEAK_THRESHOLD
35+
from wheeler_memory.dynamics import evolve_batch
36+
from wheeler_memory.fcas import cross_cube_interference, evolve_cube, portal_hash
37+
from wheeler_memory.hashing import hash_to_frame
38+
39+
# Imported read-only — does not modify the sacred benchmark corpus.
40+
from scripts.bench_quality import TEST_INPUTS
41+
42+
43+
def _peak_rate(att: np.ndarray) -> float:
44+
return float((np.abs(att) > INTERFERENCE_PEAK_THRESHOLD).mean())
45+
46+
47+
def run_probe(verbose: bool = True) -> dict:
48+
"""Aggregate cross-cube interference over the fixed corpus."""
49+
parents = [r["attractor"] for r in evolve_batch([hash_to_frame(t) for t in TEST_INPUTS])]
50+
51+
coherences: list[float] = []
52+
grounded: list[float] = []
53+
signals: list[float] = []
54+
parent_peaks: list[float] = []
55+
child_peaks: list[float] = []
56+
57+
for parent in parents:
58+
reading = cross_cube_interference(parent)
59+
coherences.extend(f["correlation"] for f in reading["per_face"].values())
60+
grounded.append(reading["grounded_fraction"])
61+
signals.append(reading["mean_signal_strength"])
62+
parent_peaks.append(_peak_rate(parent))
63+
for child_result in evolve_cube(portal_hash(parent)).values():
64+
child_peaks.append(_peak_rate(child_result["attractor"]))
65+
66+
mean_parent_peak = float(np.mean(parent_peaks))
67+
mean_child_peak = float(np.mean(child_peaks))
68+
null_grounded = mean_parent_peak * mean_child_peak
69+
noise_floor = 1.0 / np.sqrt(4096) # expected std of r for independent vectors
70+
71+
return {
72+
"n_parents": len(parents),
73+
"n_pairs": len(coherences),
74+
"mean_abs_correlation": round(float(np.mean(coherences)), 5),
75+
"max_abs_correlation": round(float(np.max(coherences)), 5),
76+
"noise_floor": round(float(noise_floor), 5),
77+
"observed_grounded_fraction": round(float(np.mean(grounded)), 5),
78+
"null_grounded_fraction": round(null_grounded, 5),
79+
"mean_parent_peak_rate": round(mean_parent_peak, 5),
80+
"mean_child_peak_rate": round(mean_child_peak, 5),
81+
"mean_signal_strength": round(float(np.mean(signals)), 5),
82+
}
83+
84+
85+
def main() -> None:
86+
parser = argparse.ArgumentParser(description="Cross-cube interference probe (§6.4)")
87+
parser.add_argument("--json", action="store_true", help="Print JSON only")
88+
args = parser.parse_args()
89+
90+
if not args.json:
91+
print(
92+
f"Cross-cube interference probe "
93+
f"({len(TEST_INPUTS)} parents × 6 children)...\n"
94+
)
95+
result = run_probe(verbose=not args.json)
96+
97+
if args.json:
98+
print(json.dumps(result))
99+
return
100+
101+
orthogonal = result["mean_abs_correlation"] < 3 * result["noise_floor"]
102+
grounded_consistent = (
103+
abs(result["observed_grounded_fraction"] - result["null_grounded_fraction"])
104+
< 0.05
105+
)
106+
107+
print(f"{'=' * 60}")
108+
print(" CROSS-CUBE INTERFERENCE PROBE")
109+
print(f"{'=' * 60}")
110+
print(f" parent×child pairs : {result['n_pairs']}")
111+
print(
112+
f" depth coherence (mean |r|): {result['mean_abs_correlation']:.5f} "
113+
f"(noise floor 1/√4096 = {result['noise_floor']:.5f})"
114+
)
115+
print(f" max |r| : {result['max_abs_correlation']:.5f}")
116+
print(
117+
f" GROUNDED observed → null : "
118+
f"{result['observed_grounded_fraction']:.4f}{result['null_grounded_fraction']:.4f}"
119+
f" (peak rates {result['mean_parent_peak_rate']:.3f} / "
120+
f"{result['mean_child_peak_rate']:.3f})"
121+
)
122+
print(f" mean signal strength : {result['mean_signal_strength']:.5f}")
123+
print(f"{'-' * 60}")
124+
verdict = (
125+
"ORTHOGONAL — children are independent of parent"
126+
if orthogonal and grounded_consistent
127+
else "NON-TRIVIAL interference detected — investigate"
128+
)
129+
print(f" verdict: {verdict}")
130+
print(f"{'=' * 60}")
131+
132+
133+
if __name__ == "__main__":
134+
main()

tests/test_cross_cube.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
"""Tests for cross-cube interference semantics (CANON §6.4)."""
2+
3+
from __future__ import annotations
4+
5+
import numpy as np
6+
7+
from wheeler_memory.dynamics import evolve_and_interpret
8+
from wheeler_memory.fcas import NUM_FACES, cross_cube_interference
9+
from wheeler_memory.hashing import hash_to_frame
10+
from wheeler_memory.interference import InterferenceResult
11+
12+
_VALID_STATES = set(InterferenceResult.STATE_CODES)
13+
14+
15+
def _parent(text: str) -> np.ndarray:
16+
return evolve_and_interpret(hash_to_frame(text))["attractor"]
17+
18+
19+
def test_cross_cube_is_deterministic():
20+
a = cross_cube_interference(_parent("a parent attractor"))
21+
b = cross_cube_interference(_parent("a parent attractor"))
22+
assert a["depth_coherence"] == b["depth_coherence"]
23+
assert a["per_face"][0]["correlation"] == b["per_face"][0]["correlation"]
24+
25+
26+
def test_six_faces_with_valid_states():
27+
r = cross_cube_interference(_parent("six faces"))
28+
assert r["n_faces"] == NUM_FACES
29+
assert set(r["per_face"]) == set(range(NUM_FACES))
30+
for face in r["per_face"].values():
31+
assert face["dominant_state"] in _VALID_STATES
32+
for key in (
33+
"grounded_fraction",
34+
"absorbed_fraction",
35+
"unconsolidated_fraction",
36+
"contested_fraction",
37+
):
38+
assert 0.0 <= face[key] <= 1.0
39+
40+
41+
def test_contested_is_zero_on_open_depth_axis():
42+
"""Zero SCM is fully open, so the closed-SCM CONTESTED state never fires."""
43+
r = cross_cube_interference(_parent("no trust gate on depth"))
44+
assert r["contested_fraction"] == 0.0
45+
for face in r["per_face"].values():
46+
assert face["contested_fraction"] == 0.0
47+
48+
49+
def test_children_are_orthogonal_to_parent():
50+
"""Canonical semantics: nested cubes are an orthogonal decomposition.
51+
52+
The portal hash decorrelates children from the parent, so mean
53+
|Pearson(parent, child)| must sit near the noise floor for independent
54+
length-4096 vectors (1/sqrt(4096) ≈ 0.0156), not climb toward 1.
55+
"""
56+
noise_floor = 1.0 / np.sqrt(4096)
57+
coherences = [
58+
cross_cube_interference(_parent(t))["depth_coherence"]
59+
for t in ("orthogonality one", "orthogonality two", "orthogonality three")
60+
]
61+
assert max(coherences) < 5 * noise_floor, (
62+
f"parent↔child coherence {coherences} exceeded the orthogonality bound; "
63+
"children are not independent of the parent"
64+
)

wheeler_memory/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
from .fcas import (
129129
Address,
130130
address_of,
131+
cross_cube_interference,
131132
evolve_cube,
132133
expand_cube,
133134
portal_hash,
@@ -224,6 +225,7 @@
224225
# FCAS address layer
225226
"Address",
226227
"address_of",
228+
"cross_cube_interference",
227229
"evolve_cube",
228230
"expand_cube",
229231
"portal_hash",

0 commit comments

Comments
 (0)