Skip to content

Fix/a3 a4 compare power fdr - #8

Merged
nareshns2004 merged 3 commits into
mainfrom
fix/a3-a4-compare-power-fdr
Nov 17, 2026
Merged

nareshns2004 merged 3 commits into
mainfrom
fix/a3-a4-compare-power-fdr

Conversation

@nareshns2004

Copy link
Copy Markdown
Owner

No description provided.

nareshns2004 and others added 3 commits November 17, 2026 20:11
At perf_event_paranoid=2 an unprivileged user may only count with
exclude_kernel=1. make_attr never set it, so every counter failed with
EACCES even though the README said level 2 was enough.

Counters now retries the whole event set with exclude_kernel=1 on
EACCES/EPERM (what perf stat does with an implicit :u), exposes
.scope, and profile records counted_scope in the recording. The
report gets cache.counted_scope plus an INFO finding when kernel mode
was excluded. PerfUnavailable now carries errno instead of callers
string-matching 'paranoid'.

Fixes the paranoid advice in the README, linux-performance doc, the
config finding and the regenerated laptop sample report.

Tests: mocked perf_event_open that refuses kernel-mode counting,
no-permission-at-all, unsupported-event skip, report surfacing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
process_node_residency came from /proc/<pid>/stat field 39, which is the
thread-group leader's last CPU. A server whose main thread sleeps on one
node while its workers run on another got the wrong residency, so the
flagship numa.process_misplaced finding could blame the wrong socket.

The recorder now also reads /proc/<pid>/task/<tid>/stat each sample,
capped by --max-threads (default 256, lowest tids, recorded in meta).
Analysis credits each thread's delta(utime+stime) between consecutive
samples to the node of the CPU it last ran on. Recordings without task
files fall back to the leader and say so in data_quality, as does a
recording that hit the thread cap.

The synthetic generator gives workers home nodes and an optional idle
leader (main_thread_node), so residency matches the spec exactly. The
ground-truth test now expects the exact mismatch 0.80; the old 0.85
only passed because of leader-sampling noise. Samples regenerated.

Tests: idle main thread on node 1 + workers on node 0 is not flagged
(and is flagged by the legacy path), thread-cap reporting, numeric tid
ordering, live task-file capture for the test process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ns (A3, A4)

A3: an exact permutation test with n runs per side can't go below
2/C(2n, n): 0.33 at n=2, 0.10 at n=3, 0.029 at n=4, 0.008 at n=5. The
hint recommended 3 runs per side, where nothing can ever be significant,
and such results were labelled 'no significant change'. Now:
- min_achievable_p() and the report header print the floor;
- verdict is 'inconclusive (too few runs)' when the floor is >= alpha;
- the hint says >= 5 runs per side (4 only works with perfect separation).

A4: 23 key metrics at alpha=0.05 expect ~1 false positive per compare.
- --primary METRIC: pre-declared metrics tested at alpha;
- all other metrics judged on Benjamini-Hochberg q-values (new column);
- metrics constant across every run are dropped from the family (a
  permutation-invariant filter, so it doesn't bias the test);
- --no-fdr and --alpha flags.

Docs: examples and ADR-10 updated with the reasoning (BH over
Bonferroni because the metrics are correlated).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nareshns2004 nareshns2004 self-assigned this Nov 17, 2026
@nareshns2004 nareshns2004 added the good first issue Good for newcomers label Nov 17, 2026
@nareshns2004
nareshns2004 merged commit 3c08833 into main Nov 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant