| Copyright | (c) 2026 Jared Tobin |
|---|---|
| License | MIT |
| Maintainer | Jared Tobin <jared@ppad.tech> |
| Safe Haskell | None |
| Language | Haskell2010 |
Censor.Runner
Description
Synopsis
- data MeterChoice
- parseMeter :: String -> Maybe MeterChoice
- meterName :: MeterChoice -> String
- withMeterArg :: Maybe String -> (String -> Meter -> IO a) -> IO a
- splitMeterName :: String
- withSplitMeterArg :: (SplitMeter -> IO a) -> IO a
- data Trace = Trace {
- traceName :: !String
- traceMeter :: !String
- traceResult :: !Result
- traceFrames :: ![Frame]
- record :: String -> String -> Meter -> Config -> Hypothesis a -> IO Trace
- thin :: [Frame] -> [Frame]
- sweep :: Meter -> Config -> (p -> IO (Hypothesis a)) -> [p] -> IO [(p, Result)]
- verdictName :: Result -> String
- shapeName :: LeakShape -> String
- summary :: Result -> String
- clipText :: Result -> String
Meter selection
data MeterChoice Source #
A meter chosen by name. The PMU variants carry their display
label alongside the Counter.
parseMeter :: String -> Maybe MeterChoice Source #
Parse a meter name: wall, instructions, cycles,
branches, ref-cycles, task-clock, branch-misses, or
cache-misses.
meterName :: MeterChoice -> String Source #
The display name of a chosen meter.
withMeterArg :: Maybe String -> (String -> Meter -> IO a) -> IO a Source #
Parse a meter token (defaulting to wall-clock when absent) and
run the callback with the resolved Meter and its name,
bracketing a PMU counter for its lifetime and dying with a clear
message if it cannot be opened (e.g. the PMU meters off Linux, or
an unknown name). Handles the whole "wall everywhere, PMU
Linux-only, hard error otherwise" dance in one place.
splitMeterName :: String Source #
The split meter's name on the command line and in reports
(cycles+wall; see withSplitMeter).
withSplitMeterArg :: (SplitMeter -> IO a) -> IO a Source #
Run the callback with a SplitMeter, dying with a clear message
if the cycle counter cannot be opened, as withMeterArg does.
Recording traces
Constructors
| Trace | |
Fields
| |
thin :: [Frame] -> [Frame] Source #
Downsample a frame list for compact plotting: keep all of the first 150 frames (the early motion), then a uniform stride, then the final frame.
Sweeps
sweep :: Meter -> Config -> (p -> IO (Hypothesis a)) -> [p] -> IO [(p, Result)] Source #
Run a parameterised family of hypotheses under one meter and return each parameter's result: the recurring "control vs swept input" pattern (a mismatch position, a length, ...).
Verdicts and rendering
verdictName :: Result -> String Source #
"REJECT" or "PASS".
shapeName :: LeakShape -> String Source #
The short label for a LeakShape, as it appears on a case row
and in the advisories block of the JSON report.
summary :: Result -> String Source #
A one-line human-readable render of a Result, suitable for
logging or embedding in a larger status line. Includes the
verdict, pairs consumed, evidence (peak log e-value, p-value),
effect interval, and clip count; on Reject it also names the
driver channel of the hedge (leakShape).
REJECT after 342 pairs; driver=bulk peakLogW=18.42 p=1.0e-8 effect=[-101.5,-98.4] clipped=6/342
clipText :: Result -> String Source #
Render a Result's clipping as one field. The tight count is
always shown; the wider bounds are appended only when clipping
actually reached them, so the common case stays as terse as it
was and a run whose effect interval saw truncated input says so.
clipped=6/342 clipped=129/138 (4c 44, 16c 3)