Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions crates/6g-mac/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ impl QBandit {
.iter()
.enumerate()
.max_by(|(i, a), (j, b)| {
let qa = self.q_value(*i, a.snr);
let qb = self.q_value(*j, b.snr);
let qa = self.q_value(*i, a.scheduler_snr());
let qb = self.q_value(*j, b.scheduler_snr());
qa.partial_cmp(&qb).unwrap_or(std::cmp::Ordering::Equal)
})
.map(|(idx, _)| idx)
Expand Down Expand Up @@ -575,6 +575,22 @@ mod tests {
);
}

#[test]
fn ai_native_uses_phy_effective_snr_bucket() {
let mut sched = Scheduler::with_policy(SchedulingPolicy::AiNative);
let mut ue0 = UeChannelState::new(UeId(1), SnrLinear::new(1.0));
ue0.apply_phy_gain_db(PowerDb::new(20.0));
let ue1 = UeChannelState::new(UeId(2), SnrLinear::new(10.0));
let states = vec![ue0.clone(), ue1.clone()];
sched.observe_reward(0, ue0.phy_effective_snr.unwrap(), 10e9);

let selected = sched.q_bandit.as_ref().unwrap().select(&states, 65_535); // deterministic no-explore branch
assert_eq!(
selected, 0,
"AI-native selector must use PHY-effective SNR when available"
);
}

#[test]
fn scheduler_validation_passes() {
let result = SchedulerValidation::validate();
Expand Down
22 changes: 11 additions & 11 deletions experiments/exp_009_5g_vs_6g_full_stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ The experiment runs **seven back-to-back sub-experiments**, each pairing a
| 6 | No sensing (comms only) | DFRC + SDF subscription | CRB range std-dev (m), event delivery |
| 7 | Raw IP bytes at UPF | Semantic PDU session | Compression ratio + task success rate |

Each sub-experiment also probes a specific architectural flaw discovered during
the cross-layer integration:
Each sub-experiment also verifies closure of the seven architectural flaws
discovered during the original cross-layer integration:

| Flaw | Module | Impact |
| Flaw | Module | Remediation status |
|------|--------|--------|
| F-1 | `6g-phy` → `6g-mac` | PHY RIS/OTFS gains are not fedback into MAC `UeChannelState` |
| F-2 | `6g-phy/waveform` | `Waveform::ber_awgn()` dispatches identically for OTFS and CP-OFDM |
| F-3 | `6g-mac/scheduler` | `QBandit` Q-table is fixed at 64 UEs; rewards for UE ≥ 64 are silently dropped |
| F-4 | `6g-ntn` | `NtnNode::leo_satellite()` hardcodes `propagation_delay_ms = 1.8` regardless of actual altitude |
| F-5 | `6g-core/upf` | `forward_semantic_uplink()` applies the codec with no check that the session type is `Semantic` |
| F-6 | `6g-core/sdf` | SDF has no event buffer; late subscribers miss all prior detection events |
| F-7 | `6g-core/upf` | `forward_unknown_flow()` returns `TriggerEstablishment` but the first packet payload is silently dropped (no buffer) |
| F-1 | `6g-phy` → `6g-mac` | PHY-effective SNR is now passed into `UeChannelState` for scheduling decisions |
| F-2 | `6g-phy/waveform` | `Waveform::ber_awgn()` now distinguishes OTFS from OFDM |
| F-3 | `6g-mac/scheduler` | `QBandit` Q-table now expands beyond 64 UEs |
| F-4 | `6g-ntn` | `NtnNode::leo_satellite()` now computes delay from altitude |
| F-5 | `6g-core/upf` | Semantic encoding now runs only for semantic sessions |
| F-6 | `6g-core/sdf` | SDF now replays retained matching events to late subscribers |
| F-7 | `6g-core/upf` | Unknown-flow first packet is now buffered for lazy establishment |

## Results

Expand All @@ -53,7 +53,7 @@ the cross-layer integration:
| Task success @ 15.6× compression | — | ≥ 90 % (semantic vs ≈ 0 % JPEG) | +90 pp |
| Architecture flaws surfaced | 0 documented | **7 identified** | test-bed value |

## Architectural Flaw Details
## F-1…F-7 Remediation Checks

### F-1: PHY→MAC Cross-Layer Decoupling
`RisChannel::snr_opt_ris()` computes a higher SNR that the MAC scheduler
Expand Down
48 changes: 24 additions & 24 deletions experiments/exp_009_5g_vs_6g_full_stack/expected_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"ber_otfs_at_8db": 1.909483e-4,
"ber_ofdm_doppler_at_8db": 4.708e-4,
"otfs_vs_ofdm_ratio_approx": 2.46,
"flaw_f2_confirmed": true,
"note": "Waveform::ber_awgn identical for OTFS and CP-OFDM"
"f2_fixed": true,
"note": "Waveform::ber_awgn distinguishes OTFS and CP-OFDM"
},

"part2_ris": {
Expand All @@ -23,8 +23,8 @@
"snr_no_ris_db": -80.0,
"snr_opt_ris_db": -31.8,
"snr_gain_db": 48.2,
"flaw_f1_confirmed": true,
"note": "RIS SNR gain not propagated to MAC UeChannelState"
"f1_fixed": true,
"note": "RIS/PHY-effective SNR is propagated to MAC UeChannelState"
},

"part3_mac": {
Expand All @@ -34,30 +34,30 @@
"rr_jain_fairness": 1.0,
"ai_jain_fairness_approx": 0.87,
"ai_high_snr_share_pct_approx": 57.0,
"flaw_f3_confirmed": true,
"note": "QBandit Q-table fixed at 64 UEs; ue_idx>=64 rewards silently dropped"
"f3_fixed": true,
"note": "QBandit Q-table expands for ue_idx>=64"
},

"part4_core": {
"rtt_5g": 4,
"rtt_6g_sbav2": 1,
"reduction_pct": 75.0,
"n_ues_registered": 8,
"flaw_f5_confirmed": true,
"flaw_f7_confirmed": true,
"note_f5": "forward_semantic_uplink applies codec regardless of PduSessionType",
"note_f7": "forward_unknown_flow drops first packet (no buffer)"
"f5_fixed": true,
"f7_fixed": true,
"note_f5": "forward_semantic_uplink checks PduSessionType before semantic encoding",
"note_f7": "forward_unknown_flow buffers first packet for lazy establishment"
},

"part5_ntn": {
"leo_altitude_m": 550000,
"leo_delay_ms": 1.835,
"haps_altitude_m": 20000,
"haps_delay_ms_correct": 0.067,
"haps_delay_ms_hardcoded": 1.8,
"haps_delay_ms_constructor": 0.067,
"geo_delay_ms": 119.4,
"flaw_f4_confirmed": true,
"note": "NtnNode::leo_satellite hardcodes 1.8 ms for every altitude"
"f4_fixed": true,
"note": "NtnNode::leo_satellite computes propagation delay from altitude"
},

"part6_isac_sdf": {
Expand All @@ -67,9 +67,9 @@
"capacity_at_alpha_0_6_gbps": 3.17,
"pd_at_pfa_1e4": 0.9128,
"events_delivered_to_prompt_subscriber": 1,
"events_delivered_to_late_subscriber": 0,
"flaw_f6_confirmed": true,
"note": "SDF has no event replay for late subscribers"
"events_delivered_to_late_subscriber": 1,
"f6_fixed": true,
"note": "SDF replays retained matching events to late subscribers"
},

"part7_semantic": {
Expand All @@ -90,13 +90,13 @@
"all_checks_passed": true
},

"flaws_identified": [
"F-1: PHY->MAC decoupling (RIS/OTFS gains not in MAC UeChannelState)",
"F-2: Waveform::ber_awgn identical for OTFS and CP-OFDM",
"F-3: QBandit Q-table fixed at 64 UEs; silent drop for ue_idx>=64",
"F-4: NtnNode::leo_satellite hardcodes propagation_delay_ms=1.8",
"F-5: forward_semantic_uplink ignores PduSessionType",
"F-6: SDF no event replay for late subscribers",
"F-7: forward_unknown_flow drops first packet"
"remediations_verified": [
"F-1: PHY->MAC cross-layer SNR path is active via UeChannelState::from_phy/phy_effective_snr",
"F-2: Waveform::ber_awgn distinguishes OTFS and CP-OFDM",
"F-3: QBandit Q-table expands beyond 64 UEs",
"F-4: NtnNode::leo_satellite computes propagation delay from altitude",
"F-5: forward_semantic_uplink gates semantic codec by PduSessionType",
"F-6: SDF late subscribers replay retained matching events",
"F-7: forward_unknown_flow buffers first packet until session establishment"
]
}
Loading
Loading