|
| 1 | +--- |
| 2 | +description: /dev/shm full-message correctness harness — capability slug, validators, goldens |
| 3 | +globs: |
| 4 | + - HPCPerfStats/monitor/scripts/emit_build_capabilities.py |
| 5 | + - HPCPerfStats/monitor/scripts/build_message_expectations.py |
| 6 | + - HPCPerfStats/monitor/scripts/validate_shm_messages.py |
| 7 | + - HPCPerfStats/monitor/scripts/lib/* |
| 8 | + - HPCPerfStats/monitor/tests/test_shm_message_correctness.sh |
| 9 | + - HPCPerfStats/monitor/tests/expected/shm_* |
| 10 | + - HPCPerfStats/monitor/tests/expected/capabilities_* |
| 11 | + - HPCPerfStats/monitor/tests/expected/expectations_* |
| 12 | +alwaysApply: false |
| 13 | +--- |
| 14 | + |
| 15 | +# Monitor: /dev/shm message correctness |
| 16 | + |
| 17 | +## Scope |
| 18 | + |
| 19 | +- Validates **full outbound monitor payloads** mirrored under `HPCPERFSTATS_DEBUG_SHM_DIR` (`schema`, `fast`, `full`). |
| 20 | +- **Out of scope:** listend, archive files, RabbitMQ consumer path. |
| 21 | +- Requires **DEBUG build** (`--enable-debug`) for live shm capture (**monitor-debug-shm**). |
| 22 | + |
| 23 | +## Capability slug |
| 24 | + |
| 25 | +- Emitted by `scripts/emit_build_capabilities.py` → `<builddir>/monitor-build-capabilities.json`. |
| 26 | +- `make capabilities` in configured build tree; `build_static_bundle.sh` invokes unless `SKIP_CAPABILITIES=1`. |
| 27 | +- Slug tokens (omit absent): `arch`, `ver`, `debug`, `hw`, `ib`, `nvgpu`, `amdgpu`, `lustre`, `opa`, `dcgm|likwid|none`, `slowtier0|slowtier1`. |
| 28 | +- **All fixtures** use slug in filename: `expectations_<slug>.json`, `tests/expected/shm_{schema,fast,full}_<slug>.txt`. |
| 29 | +- Validator **layer 0**: manifest slug must match capabilities JSON; exit 2 on mismatch. |
| 30 | +- CI/integration: **exit 77 skip** when no goldens for live slug — never fall back to generic golden. |
| 31 | + |
| 32 | +## Artifacts |
| 33 | + |
| 34 | +| Local (gitignored) | Committed | |
| 35 | +|--------------------|-----------| |
| 36 | +| `test_runs/monitor/validate_<slug>_*.txt` | `tests/expected/shm_*_<slug>.txt` | |
| 37 | +| `test_runs/monitor/shm_snapshot_<host>_<slug>/` | `scripts/lib/*.py` | |
| 38 | + |
| 39 | +## Data-host runbook |
| 40 | + |
| 41 | +1. `build_static_bundle.sh` with `--enable-debug` → `make -C .build-static capabilities`. |
| 42 | +2. Run daemon; read `schema`/`fast`/`full` from shm. |
| 43 | +3. `build_message_expectations.py --capabilities …` → `expectations_<slug>.json`. |
| 44 | +4. `validate_shm_messages.py` (optional `--spot-check-values`). |
| 45 | + |
| 46 | +## Tests |
| 47 | + |
| 48 | +- C: `test_stats_buffer_debug_shm.c`, `test_debug_shm_schema_mirror.c` (**monitor-debug-shm**). |
| 49 | +- Shell: `test_shm_message_correctness.sh` (slug-aware). |
| 50 | +- Python via repo `.venv` (**python-venv-enforcement**). |
| 51 | + |
| 52 | +Cross-links: **monitor-collect-tier-gating**, **monitor-schema-keys-headers**, **monitor-c-testing-standards**, **test-runs-output-directory**. |
0 commit comments