omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / research / m15 / spbm / README.md
| 1 | # GB10 SPBM measurement reader |
| 2 | |
| 3 | This directory contains preliminary R15 telemetry work. It does not issue an |
| 4 | R15 PASS. The complete performance harness and qualification remain required. |
| 5 | |
| 6 | ## Reader boundary |
| 7 | |
| 8 | `aien_spbm_readonly.c` is an out-of-tree Linux platform driver for this |
| 9 | machine's ACPI `NVDA8800` device. Before mapping anything, it checks the |
| 10 | firmware's `_DSM` resource name and all fifteen permitted register names and |
| 11 | offsets against `contract.h`. It requires exactly the expected 4 KiB SPBM |
| 12 | resource and reserves it through `devm_ioremap_resource`. A changed firmware |
| 13 | layout fails the probe. There is no fallback address, module parameter, |
| 14 | power-cap control, MMIO write, or access to CLEAR_OVERFLOW registers. |
| 15 | |
| 16 | The ten hwmon measurement attributes and five raw overflow attributes are |
| 17 | read-only. An energy read checks its overflow indicator before and after |
| 18 | reading the counter and returns `EOVERFLOW` if either is nonzero. Firmware |
| 19 | rollover semantics are not experimentally established. The sampler rejects a |
| 20 | backward counter, any overflow, insufficient counter headroom for the window, |
| 21 | and malformed or missing samples; it does not guess how to unwrap them. |
| 22 | |
| 23 | Register locations were independently checked against this machine's |
| 24 | disassembled DSDT (SHA-256 |
| 25 | `2871cbcb8992f7bd3915d6f19e7cfab577e068dcad58b6f00317a9f2d4e1b28e`). |
| 26 | The ACPI discovery protocol and milli-unit convention are also described by |
| 27 | [spark_hwmon](https://github.com/antheas/spark_hwmon/blob/352c76e538cadece0e4887a153fef95f8f5ea1d4/spbm.c), |
| 28 | licensed GPL-2.0. This reader follows that protocol but implements a narrower |
| 29 | read-only contract. The firmware table supplies names and offsets, not a |
| 30 | published accuracy specification. |
| 31 | |
| 32 | ## Units and limits |
| 33 | |
| 34 | Raw energy is interpreted as 32-bit millijoules, exposed as microjoules. Raw |
| 35 | power is interpreted as milliwatts, exposed as microwatts. The representational |
| 36 | energy step is 1 mJ; that is not a claim of 1 mJ measurement accuracy. |
| 37 | |
| 38 | Energy channels are package, CPU-E, CPU-P, GPC and GPM. GPC stayed at zero in |
| 39 | every collected window and is explicitly labelled `gpc_unverified`. It must |
| 40 | not be used as evidence of zero GPU energy. GPM is the functioning graphics |
| 41 | counter. The separately sampled NVML graphics counter covers a different |
| 42 | measurement boundary; equality with GPM is not assumed. |
| 43 | |
| 44 | The package energy rate exceeded the integrated instantaneous package power |
| 45 | by 0.27 to 0.52 W in the completed vector-load collection. The source of that |
| 46 | discrepancy has not been established. Do not silently subtract it or call it |
| 47 | calibrated accuracy. Neither source was compared with an external meter. |
| 48 | These are on-device package measurements, not wall-outlet measurements. |
| 49 | They cannot confirm or rule out a short electrical disturbance at the outlet. |
| 50 | |
| 51 | CPU sensor reads and NVML calls have separate timestamp intervals. NVML may |
| 52 | block for several milliseconds; that delay must not be assigned to the CPU |
| 53 | counter observation. All raw read intervals are retained. |
| 54 | |
| 55 | ## Preliminary collections |
| 56 | |
| 57 | - `runs/preflight-20260928-01`: initial scalar load, completed. Its older |
| 58 | timestamp format grouped NVML with CPU sensor reads; exploratory only. |
| 59 | - `runs/preflight-20260928-02`: vector load, aborted when that grouped read |
| 60 | span exceeded 10 ms. Partial records are retained; no successful status. |
| 61 | - `runs/preflight-20260928-03`: corrected independent timestamps; three |
| 62 | idle, three CPU-P and three CPU-E windows, 101 samples per 10-second |
| 63 | window. It completed. `summary.json` is exactly reproduced by `reduce`. |
| 64 | |
| 65 | In collection 03, package energy rates were 19.65 to 19.85 W at idle and |
| 66 | 22.79 to 22.96 W under the CPU-P load. CPU-P's own rate rose from 1.87 to 2.07 W |
| 67 | to 6.78 to 6.86 W. CPU-E's rate rose from 0.28 to 0.33 W at idle to 2.02 to 2.22 W |
| 68 | under its load. All overflow indicators were zero. Each worker's CPU time and |
| 69 | verified core affinity are recorded. Other machine activity was present and |
| 70 | recorded; these runs are not a quiet-machine R15 qualification. |
| 71 | |
| 72 | Checks completed: signed reader loaded with Secure Boot enabled; firmware |
| 73 | contract accepted; malformed register contracts rejected under address and |
| 74 | undefined-behavior sanitizers; measurement attributes read-only; collection |
| 75 | checksums verified; summary reproduced byte-for-byte; energy and integrated |
| 76 | power calculations independently recomputed; damaged records with overflow, |
| 77 | counter decrease, missing sample, and incorrect sequence rejected. |
| 78 | |
| 79 | After the operator reported a power surge, the load processes were confirmed |
| 80 | stopped and the telemetry module was unloaded. The code changed no power |
| 81 | limit or CPU governor. The operator has since authorized continuing work; |
| 82 | give a clear heads-up before further load-generating tests. |
| 83 | |
| 84 | Forensic audit, 2026-09-28 12:00 (host journal): the surge report was at |
| 85 | 10:36 during the collection-02 CPU load; the module was removed at 10:37. |
| 86 | It was loaded again at 10:53 and 11:09 from this directory by a session |
| 87 | whose log is not on the Spark, and `kernel.perf_event_paranoid` was set to |
| 88 | 0 (boot default 4, `CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y`). The owner |
| 89 | approved leaving the read-only module loaded; paranoid was restored to 4 at |
| 90 | the audit. The loaded module's srcversion (`D7345BB5C0CCFCB7B177335`) and |
| 91 | `.ko` SHA-256 match `runs/preflight-20260928-03/source-binary.sha256`, and |
| 92 | its signature serial matches the enrolled owner key. Secure Boot and |
| 93 | integrity lockdown were on throughout. |
| 94 | |
| 95 | ## Reproduction |
| 96 | |
| 97 | `make` builds the module against the running kernel; `make tools check` |
| 98 | builds the small C sampler, bounded CPU load, reducer and contract checks. |
| 99 | The module must be signed with the already enrolled owner key before manual |
| 100 | loading. No service, boot autoload configuration, or power-control setting is |
| 101 | installed. The private key remains outside this repository. |
| 102 | |
| 103 | `bash collect.sh NEW-DIRECTORY` deliberately drives ten CPU cores for |
| 104 | 14 seconds per load period, six periods total. It increases CPU activity and |
| 105 | can increase power draw. The sampler records 10 seconds within each period. |
| 106 | The collector refuses an existing directory and stops its load child on exit. |
| 107 | The module must already be loaded; the collector does not load it. |
| 108 | |
| 109 | `./reduce RUN-DIRECTORY` reads only saved files and reproduces the V2 summary. |
| 110 | `sha256sum -c SHA256SUMS` inside a completed run verifies its recorded files. |
| 111 | The source/binary checksum list is checked from this directory. Earlier |
| 112 | exploratory runs intentionally bind earlier source versions. |