P6 multi-seed re-audit: N_TTIS=30000, 5 seeds, gate criteria from P6_… #176
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
| name: CI | |
| on: | |
| push: | |
| branches: [ main, dev ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pytest | |
| - name: Run tests | |
| run: pytest tests/ -v --tb=short | |
| - name: Run scheduler example (smoke test) | |
| run: | | |
| # Quick smoke test: 200 TTIs instead of full 3000 | |
| python -c " | |
| import sys; sys.path.insert(0,'.') | |
| from nr_simulator.cell import CellLayout | |
| from projects.p1_scheduler import BLERAwarePFScheduler | |
| from projects.p5_kpi_framework import KPICollector | |
| from nr_simulator.constants import NRConstants | |
| import numpy as np | |
| rng = np.random.default_rng(0) | |
| cell = CellLayout(n_ue_per_cell=5, seed=0) | |
| coll = KPICollector(n_ues=5) | |
| sched = BLERAwarePFScheduler() | |
| for _ in range(200): | |
| cell.step_all_ues() | |
| scheduled = sched(cell.ues, 51) | |
| coll.record_tti(cell.ues, scheduled, 0.0) | |
| for ue, mcs, n_rb, _ in scheduled: | |
| coll.record_bler_outcome(ue.ue_id, rng.random()>0.1) | |
| ue.record_transmission(mcs, n_rb) | |
| s = coll.summarise() | |
| assert s.system_throughput_mbps > 0 | |
| assert 0 <= s.jains_fairness_index <= 1 | |
| print(f'Smoke test passed: {s.system_throughput_mbps:.2f} Mbps, J={s.jains_fairness_index:.3f}') | |
| " |