mirror of
https://github.com/allaunthefox/SilverSight.git
synced 2026-07-31 01:25:21 +00:00
fix: COUCH gate — Kelvin wave regime check
The COUCH gate now has TWO stages (matching BraidStateN.lean): Stage A — Rossby/Kelvin regime: - Rossby drift ≠ 0 → Rossby regime (dispersive, active mixing) → PASS - Rossby drift = 0 → Kelvin regime (boundary-trapped, NO mixing) → FAIL The Kelvin regime is the degenerate case: perfectly balanced chiral distribution. Energy dissipation rate is ZERO (proven in rossby_energy_dissipation_rate: requires isActive=true). kelvinLabels8 (all achiral_stable) → drift=0 → Kelvin → FAIL rossbyLabels8 (alternating left/right) → drift≠0 → Rossby → PASS This is the 'q=1 degenerate' / 'rational surface' / 'stuck' case. Stage B — scarred contention: - scarred_count → self_loop → threshold (unchanged) A config passes COUCH iff BOTH stages pass. Updated both pipeline_core.py (Python) and chiral_cross_enrich.wgsl (GPU shader) with the Kelvin check.
This commit is contained in:
parent
3cbf5a2560
commit
e61ee5cfdc
2 changed files with 49 additions and 20 deletions
|
|
@ -113,21 +113,30 @@ fn compute_helical(step: u32) -> u32 {
|
||||||
return ((step * GOLDEN_ANGLE) / Q16_ONE) % EXOTIC_CLASSES;
|
return ((step * GOLDEN_ANGLE) / Q16_ONE) % EXOTIC_CLASSES;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// COUCH stability: scarred count → self-loop → threshold check.
|
/// COUCH stability: two-stage check.
|
||||||
|
/// Stage A: Rossby/Kelvin regime (drift=0 → Kelvin → boundary-trapped → FAIL)
|
||||||
|
/// Stage B: scarred contention (self-loop < threshold)
|
||||||
fn compute_couch(config_id: u32) -> u32 {
|
fn compute_couch(config_id: u32) -> u32 {
|
||||||
|
// Stage A: Rossby drift must be non-zero (Kelvin regime fails)
|
||||||
|
let drift = compute_rossby(config_id);
|
||||||
|
if (drift == 0) {
|
||||||
|
// Kelvin regime: boundary-trapped, no mixing, zero dissipation
|
||||||
|
// (proven: rossby_energy_dissipation_rate requires isActive)
|
||||||
|
return 0u; // COUCH FAILS — stuck like AVX-512 (self_loop=0.885)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stage B: scarred contention check
|
||||||
var scarred_count: u32 = 0u;
|
var scarred_count: u32 = 0u;
|
||||||
for (var s: u32 = 0u; s < N_STRANDS; s = s + 1u) {
|
for (var s: u32 = 0u; s < N_STRANDS; s = s + 1u) {
|
||||||
if (get_chiral_type(config_id, s) == 1u) { // chiral_scarred
|
if (get_chiral_type(config_id, s) == 1u) { // chiral_scarred
|
||||||
scarred_count = scarred_count + 1u;
|
scarred_count = scarred_count + 1u;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// self_loop = 57942 * scarred_count / 8 (Q16_16)
|
|
||||||
let self_loop = (57942u * scarred_count) / N_STRANDS;
|
let self_loop = (57942u * scarred_count) / N_STRANDS;
|
||||||
// COUCH stable if self_loop < threshold
|
|
||||||
if (self_loop < COUCH_THRESHOLD) {
|
if (self_loop < COUCH_THRESHOLD) {
|
||||||
return 1u; // stable
|
return 1u; // COUCH PASSES — Rossby active + low contention
|
||||||
}
|
}
|
||||||
return 0u; // unstable
|
return 0u; // COUCH FAILS — too much scarred contention
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Main kernel: each thread processes one cross-enriched configuration.
|
/// Main kernel: each thread processes one cross-enriched configuration.
|
||||||
|
|
|
||||||
|
|
@ -257,16 +257,28 @@ class MultisurfacePacker(Filter):
|
||||||
# ── Stage 5: COUCH — Geometric stability via Rossby drift ─────────────
|
# ── Stage 5: COUCH — Geometric stability via Rossby drift ─────────────
|
||||||
|
|
||||||
class COUCHFilter(Filter):
|
class COUCHFilter(Filter):
|
||||||
"""COUCH gate: Rossby drift determines stability.
|
"""COUCH gate: two-stage stability check.
|
||||||
|
|
||||||
Uses the ACTUAL rossbyDriftFromChirality from BraidStateN.lean:
|
Stage A — Rossby/Kelvin regime check (from BraidStateN.lean):
|
||||||
left=+65536, right=-65536, scarred=+32768, achiral=0
|
- Rossby drift ≠ 0 → Rossby regime (dispersive, active mixing) → PASS
|
||||||
|
- Rossby drift = 0 → Kelvin regime (boundary-trapped, NO mixing) → FAIL
|
||||||
|
|
||||||
Non-zero drift → Rossby regime (active, dispersive) → COUCH passes
|
The Kelvin regime is the degenerate case: perfectly balanced chiral
|
||||||
Zero drift → Kelvin regime (boundary-trapped) → COUCH may fail
|
distribution (left+right cancel, no scarred). Energy dissipation rate
|
||||||
|
is ZERO (proven: rossby_energy_dissipation_rate requires isActive).
|
||||||
|
This is the "q=1 degenerate" / "rational surface" / "AVX-512 stuck"
|
||||||
|
case — the system can't mix.
|
||||||
|
|
||||||
Also computes helical_residue (winding number mod 28) from
|
rossbyLabels8 (BraidStateN.lean line 327): alternating left/right
|
||||||
HopfFibration.lean: ⌊k·ψ⌋ mod 28 where ψ=25042 (Q16_16).
|
→ drift ≠ 0 → Rossby → dispersive → COUCH passes
|
||||||
|
kelvinLabels8 (BraidStateN.lean line 338): all achiral_stable
|
||||||
|
→ drift = 0 → Kelvin → boundary-trapped → COUCH fails
|
||||||
|
|
||||||
|
Stage B — Scarred contention check (from HCMR):
|
||||||
|
- scarred_count → self_loop proxy → threshold check
|
||||||
|
- High scarred count = high contention = AVX-512 regime
|
||||||
|
|
||||||
|
A config passes COUCH iff BOTH stages pass.
|
||||||
"""
|
"""
|
||||||
def __init__(self, threshold=Q16_THRESHOLD_COUCH): self.threshold = threshold
|
def __init__(self, threshold=Q16_THRESHOLD_COUCH): self.threshold = threshold
|
||||||
@property
|
@property
|
||||||
|
|
@ -274,18 +286,26 @@ class COUCHFilter(Filter):
|
||||||
def apply(self, configs, ctx):
|
def apply(self, configs, ctx):
|
||||||
result = []
|
result = []
|
||||||
for c in configs:
|
for c in configs:
|
||||||
# Rossby drift (actual implementation from BraidStateN.lean)
|
# Stage A: Rossby/Kelvin regime
|
||||||
drift, is_active = rossby_drift(c.chiral)
|
drift, is_active = rossby_drift(c.chiral)
|
||||||
c.rossby_drift = drift
|
c.rossby_drift = drift
|
||||||
# Helical residue (winding number mod 28, from HopfFibration.lean)
|
if not is_active:
|
||||||
|
# Kelvin regime: boundary-trapped, no mixing → COUCH FAILS
|
||||||
|
c.metadata["regime"] = "kelvin"
|
||||||
|
c.self_loop = Q16_AVX_SELFLOOP # stuck, like AVX-512
|
||||||
|
continue
|
||||||
|
c.metadata["regime"] = "rossby"
|
||||||
|
|
||||||
|
# Stage B: scarred contention
|
||||||
|
scarred_count = sum(1 for cl in c.chiral if cl == "chiral_scarred")
|
||||||
|
c.self_loop = (Q16_AVX_SELFLOOP * scarred_count) // max(len(c.chiral), 1)
|
||||||
|
if c.self_loop >= self.threshold:
|
||||||
|
continue # too much contention
|
||||||
|
|
||||||
|
# Helical residue (winding mod 28, from HopfFibration.lean)
|
||||||
step = c.metadata.get("step", 0)
|
step = c.metadata.get("step", 0)
|
||||||
c.helical_residue = helical_residue(step)
|
c.helical_residue = helical_residue(step)
|
||||||
# COUCH stable if Rossby active (non-zero drift) or scarred count low
|
result.append(c)
|
||||||
scarred_count = sum(1 for cl in c.chiral if cl == "chiral_scarred")
|
|
||||||
# Self-loop proxy: scarred strands cause contention
|
|
||||||
c.self_loop = (Q16_AVX_SELFLOOP * scarred_count) // max(len(c.chiral), 1)
|
|
||||||
if c.self_loop < self.threshold:
|
|
||||||
result.append(c)
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue