Skip to content

Commit 6c972ac

Browse files
merge: resolve conflicts — keep worktree versions of .gitignore and ROADMAP.md
2 parents 08c9dea + 564c23a commit 6c972ac

40 files changed

Lines changed: 17248 additions & 365 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,4 +295,6 @@ papers/
295295
# Training: track source code, ignore outputs
296296
training/outputs/
297297
training/**/__pycache__/
298+
299+
# Git worktrees (generated by git-worktree, never committed)
298300
.worktrees/

ROADMAP.md

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# DiffAudit Research Roadmap
22

3-
> Last updated: 2026-07-11
3+
> Last updated: 2026-07-12
44
> Scope: current Research execution board.
5+
>
6+
> Implementation branch: `feat/paper1-corrected-evidence`. See `.worktrees/paper1-corrected-evidence` for active code.
57
68
## Current Baseline
79

@@ -26,6 +28,14 @@ not estimate a population-level seed variance or establish a mechanism.
2628
Current command runbook:
2729
`docs/start-here/paper1-corrected-evidence-runbook-2026-07-11.md`.
2830

31+
The first formal corrected matrix was stopped outcome-blind at step 22,000 on
32+
its first target when the post-training audit found that canonical PIA could not
33+
load corrected `ema` checkpoints and lacked the frozen complete-roster
34+
statistics. No membership outcome was generated or viewed. The partial target
35+
is permanently excluded. The protocol is being refrozen after corrected EMA
36+
loading, repository-bound analysis provenance, canonical target ordering, and
37+
1,000-draw H1/PIA paired bootstrap are completed.
38+
2939
## P0: Freeze the Corrected Evidence Contract
3040

3141
- [x] Train only on the fixed 25,000-row member subset.
@@ -39,33 +49,55 @@ Current command runbook:
3949
- [x] Add confirmatory H1 scoring that fits PCA/LR only on calibration rows and
4050
reports metrics only on evaluation rows.
4151
- [x] Add stratified paired bootstrap that refits the attack inside each
42-
replicate, plus at least 200 full label-permutation refits.
43-
- [x] Repair PIA canonical and pass a positive-control gate before it is used as
52+
replicate, plus at least 200 full label-permutation refits. Paired bootstrap
53+
is now 1,000 draws so the eight-target Holm family is mathematically capable
54+
of rejection.
55+
- [x] Repair PIA canonical and pass a synthetic-checkpoint positive-control gate
56+
before it is used as
4457
the validation attack. Historical E3 PIA outputs are not valid for this gate.
4558
- [x] Implement and test exact resume, including Python/NumPy/Torch CPU/CUDA and
4659
data-loader state, or freeze a common restart policy and block uninterrupted-
4760
trajectory claims.
48-
- [x] Add row-bound score packets with dataset/run/checkpoint/noise/protocol
49-
identities.
61+
- [x] Add strict row-bound H1 and PIA packet schemas with
62+
dataset/run/checkpoint/noise/protocol identities.
63+
- [ ] Bind H1 activation extraction to the locked rows and common-noise contract,
64+
then generate a preflight score packet from the corrected checkpoint.
5065

51-
Implementation branch: `feat/paper1-corrected-evidence` (commit `d6ef148`).
66+
P0 gates implemented on `feat/paper1-corrected-evidence` (commit `d6ef148`).
5267
Protocol v3 hash: `b73b8244`. 304 focused tests pass.
5368

5469
No corrected outcome may be viewed before these protocol choices are frozen.
5570

5671
## P1: Short GPU Preflight
5772

58-
- [x] Run a disposable 2k-step `corrected-*` target: batch 32, seed 1746574482.
59-
- [x] dataset length is exactly 25,000 and split sets are disjoint
60-
- [x] no historical checkpoint/output directory is reused
61-
- [x] no OOM with the live 8 GB GPU state (peak ~6.74 GiB, min free ~1.21 GiB)
62-
- [x] sustained throughput at least 6.0k steps/hour (observed ~12.3k/h)
63-
- [x] checkpoint/resume and manifest checks pass
64-
- [x] projected training plus full evaluation plus 10% buffer fits 6-day window
73+
- [x] P1 preflight done: training throughput gate passed; full H1+PIA evaluation
74+
benchmark pending protocol regeneration.
75+
76+
Run a disposable 2k--5k-step `corrected-*` target before long training.
77+
78+
Pass criteria:
79+
80+
- dataset length is exactly 25,000 and split sets are disjoint;
81+
- no historical checkpoint/output directory is reused;
82+
- no OOM with the live 8 GB GPU state;
83+
- sustained throughput is at least 6.0k steps/hour without thermal throttling;
84+
- checkpoint/resume and manifest checks pass;
85+
- row-bound evaluation artifacts include all required identities.
86+
- projected training plus full evaluation plus a 10% failure buffer fits the
87+
available GPU window; otherwise reduce the matrix symmetrically before any
88+
corrected metric is viewed and refreeze the manifest.
89+
90+
Failure pauses long training. Fix the contract, repeat the same preflight seed,
91+
and record the deviation; do not replace the seed.
6592

66-
Preflight passed 2026-07-12. Protocol v3 frozen. GPU queue ready.
93+
2026-07-12 status: the original batch-64 preflight failed the throughput and
94+
VRAM-headroom gates. The contract was revised before viewing any corrected
95+
metric to batch size 32, then refrozen. The corrected 0 -> 200 -> 400 -> 2,000
96+
run passed training, exact-resume, checkpoint receipt, thermal, throughput, and
97+
output-schema checks. Long training remains blocked on one complete H1 + PIA
98+
checkpoint-evaluation benchmark and the H1 extraction binding above.
6799

68-
## P2: First-Stage Matrix — 4 Targets × 100k
100+
## P2: First-Stage Matrix — 4 Targets x 100k
69101

70102
Train the first four predeclared seeds symmetrically to 100k. Use independent
71103
`corrected-*` directories and never resume seed42/43/44/45 or other historical

configs/attacks/pia-mainline-canonical.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,22 @@ attack:
1212
method: pia
1313
num_samples: 128
1414
parameters:
15+
variant: canonical-ddpm-eq9
1516
attacker_name: PIA
16-
attack_num: 30
17-
interval: 10
17+
timestep: 200
18+
lp_order: 4
19+
score_form: negative_lp_norm
20+
score_direction: higher_is_member
21+
input_range: [-1.0, 1.0]
22+
query_timesteps: [0, 200]
23+
query_count: 2
24+
normalization: per_row_vector_lp
25+
beta_semantics: linear_1000_steps_inclusive_0.0001_to_0.02
26+
threshold_calibration: maximize_balanced_accuracy_then_minimize_fpr_then_highest_threshold
27+
positive_control_gate:
28+
auc_min: 0.95
29+
balanced_accuracy_min: 0.90
30+
fpr_max: 0.05
1831
batch_size: 8
1932
report:
2033
output_dir: workspaces/gray-box/runs

docs/evidence/experiment-master-log.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
| Item | Verdict | Evidence |
1414
| --- | --- | --- |
1515
| **Phase G H1 historical baseline** | **Quarantined.** Local seed42/43/45 targets trained on rows labeled as nonmembers, and the old H1 scorer reported resubstitution AUC. All old AUCs, continuation directions, N=512 clusters, knockout/fine-grid interpretations, and mechanism claims are diagnostic-only. Never resume these checkpoints into corrected runs. | [frozen-claim-matrix.md](../paper1/frozen-claim-matrix.md) |
16-
| **Paper 1 corrected-evidence rebuild** | Active protocol, no result yet. Freeze member-only training, predeclared seeds, disjoint calibration/evaluation rows, common noise, H1 held-out scoring, PIA positive control, and STOP/REPLICATE/MATURE rules before viewing any corrected outcome. | [paper1-corrected-evidence-runbook-2026-07-11.md](../start-here/paper1-corrected-evidence-runbook-2026-07-11.md) |
16+
| **Paper 1 corrected-evidence rebuild** | Batch-32 training and exact-resume resource preflight passed. The first formal matrix was then stopped outcome-blind at step 22,000 on its first target after a post-training audit found that canonical PIA could not load corrected `ema` checkpoints and lacked the frozen complete-roster statistics. No membership outcome was generated or viewed. The partial target is permanently excluded; corrected EMA loading, analysis provenance, canonical roster ordering, PIA confirmatory statistics, and 1,000-draw H1/PIA paired bootstrap are being refrozen before a fresh restart. | [paper1-corrected-training-preflight-2026-07-12.md](paper1-corrected-training-preflight-2026-07-12.md) |
1717
| DualMD / DistillMD defense artifact gate | OpenReview DDMD supplement code and DDPM split-index files are public, but the embedded GitHub origin is not public and no checkpoint-bound defended/undefended scores, ROC arrays, metric JSON, generated response packet, or ready verifier are committed; no download, GPU release, or admitted defense row | [dual-md-distillmd-defense-artifact-gate-2026-05-15.md](dualmd-distillmd-defense-artifact-gate-2026-05-15.md) |
1818
| DIFFENCE classifier-defense artifact gate | official code, configs, and split-index files are public, but the protected target is an image classifier, diffusion is a pre-inference defense component, and no checkpoint-bound defended/undefended logits, score rows, ROC arrays, metric JSON, or ready verifier are committed; no download, GPU release, or admitted defense row | [diffence-classifier-defense-artifact-gate-2026-05-15.md](diffence-classifier-defense-artifact-gate-2026-05-15.md) |
1919
| MIAHOLD / HOLD++ higher-order Langevin defense gate | official defense code, audio split filelists, CIFAR HOLD config, and PIA-style attack code are public, but checkpoint-bound target artifacts, reusable member/nonmember scores, ROC arrays, metric JSON, generated responses, and a ready verifier are missing; no download, GPU release, or admitted defense row | [miahold-higher-order-langevin-artifact-gate-2026-05-15.md](miahold-higher-order-langevin-artifact-gate-2026-05-15.md) |
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Paper 1: corrected training preflight
2+
3+
- **Date**: 2026-07-12
4+
- **Status**: superseded by outcome-blind evaluation-contract repair
5+
- **Verdict**: Batch size 32 passed the training and exact-resume resource gate, but the first formal matrix was stopped before outcomes when the canonical PIA post-training path was found incomplete.
6+
7+
## Scope
8+
9+
This preflight tested only the corrected member-only training contract and its
10+
artifact chain. It did not inspect H1, PIA, AUC, or any other membership outcome.
11+
The run used the first predeclared seed, 25,000 fixed member rows, the frozen
12+
split SHA256, and corrected-only output labels.
13+
14+
## Resource correction before outcomes
15+
16+
The initial batch-64 attempt was stopped before completion. Observed GPU memory
17+
reached about 7.9 GiB on an 8 GiB device, leaving only tens of MiB free, and
18+
2,000 steps had not completed after about 22 minutes. This failed the frozen
19+
6.0k steps/hour and VRAM-headroom gates.
20+
21+
Before any corrected metric was viewed, the canonical training config was
22+
changed once to batch size 32. No model, optimizer, schedule, precision, seed,
23+
or step horizon was changed. The protocol was then rebuilt and hash-sealed.
24+
25+
## Passing run
26+
27+
The replacement run used three segments to exercise resume:
28+
29+
| Segment | Wall time | Approx. throughput |
30+
| --- | ---: | ---: |
31+
| 0 -> 200 | 57 s | 12.6k steps/hour |
32+
| 200 -> 400 | 67 s | 10.7k steps/hour, including resume overhead |
33+
| 400 -> 2,000 | 459 s | 12.5k steps/hour |
34+
| Active total | 583 s | 12.3k steps/hour |
35+
36+
Observed runtime bounds:
37+
38+
- fresh-run GPU allocation: about 5.50 GiB;
39+
- resume peak GPU allocation: about 6.74 GiB;
40+
- minimum observed free GPU memory: about 1.21 GiB;
41+
- maximum observed temperature: 71 C;
42+
- maximum observed power draw: about 103 W;
43+
- no OOM or observed thermal throttling.
44+
45+
## Artifact checks
46+
47+
The run produced checkpoints at steps 200, 400, and 2,000. For every checkpoint:
48+
49+
- the on-disk SHA256 matches its manifest receipt;
50+
- checkpoint metadata records the same protocol hash, split SHA256, code commit,
51+
seed, step, and batch-32 training-config hash;
52+
- the manifest retains all three receipts after resume;
53+
- `weights_only=True` loading succeeds on CPU;
54+
- log terminal events report the expected final step without interruption.
55+
56+
Generated checkpoints and logs remain outside Git under the configured download
57+
and training-output roots.
58+
59+
## Decision
60+
61+
The corrected training implementation passes Stage 0's training, resource,
62+
resume, and receipt gates. This does not release the four 100k targets. The next
63+
required gate is a complete evaluation benchmark on the 2,000-step checkpoint:
64+
65+
1. extract H1 activations only for the locked calibration/evaluation rows;
66+
2. derive common noise from the sealed row/timestep/draw contract;
67+
3. emit strict row-bound H1 and PIA score packets;
68+
4. time the full H1 + PIA evaluation and project the worst non-STOP branch with
69+
a 10% failure buffer.
70+
71+
No long training begins until that projection fits the available GPU window.
72+
73+
## Outcome-blind formal-matrix abort
74+
75+
The full H1 and canonical PIA timing projection subsequently fit the available
76+
window. A formal Stage 1 launch therefore began on the frozen target matrix.
77+
During an independent audit of the commands that would consume the completed
78+
100k checkpoints, two remaining P0 gaps were found before any membership score
79+
or metric was generated:
80+
81+
1. the formal canonical PIA exporter accepted legacy `ema_model`/`net_model`
82+
checkpoint keys but not the corrected trainer's `ema` key;
83+
2. the PIA path did not yet expose the predeclared complete-roster paired
84+
bootstrap, global AUC-range test, and Holm family required for the paper
85+
decision.
86+
87+
The first target was stopped at step 22,000. Its final saved checkpoint receipt
88+
matched its on-disk SHA256; the other three targets had not started. This partial
89+
target is an infrastructure-abort artifact and MUST NOT be resumed or scored.
90+
91+
Because no corrected outcome had been viewed, the protocol was reopened rather
92+
than patched after results. The repair adds corrected EMA loading, explicit
93+
analysis repository-state provenance, canonical target ordering, PIA
94+
confirmatory statistics, and 1,000 paired bootstrap draws for both H1 and PIA.
95+
The increase from 200 to 1,000 is required because 200 plus-one draws make Holm
96+
rejection mathematically unreachable for the 28 pairs in an eight-target set.
97+
98+
Long training remains blocked until the repaired code is committed, a new
99+
protocol hash is sealed, and the necessary dry-run/resource preflight is
100+
repeated with fresh output labels. The aborted target and its protocol are never
101+
part of corrected evidence.

docs/start-here/paper1-corrected-evidence-runbook-2026-07-11.md

Lines changed: 65 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Paper 1 Corrected Evidence Runbook
22

33
> Date: 2026-07-11
4-
> Status: active protocol scaffold; long training remains gated by the checks below.
4+
> Status: active protocol repair; the first formal launch was stopped outcome-blind and must be restarted under a new sealed hash.
55
66
This runbook supersedes `phase-g-runbook-2026-06-30.md`. It rebuilds the H1
77
evidence contract after the previous local targets and resubstitution scorer
@@ -56,14 +56,23 @@ Long training is blocked until all items pass:
5656

5757
```powershell
5858
conda activate diffaudit
59-
$env:DIFFAUDIT_DATASET_ROOT = "<DIFFAUDIT_ROOT>\Download\datasets-readable"
6059
$env:DIFFAUDIT_DOWNLOAD_ROOT = "<DIFFAUDIT_ROOT>\Download"
60+
$env:DIFFAUDIT_CIFAR10_ROOT = "<CIFAR10_ROOT>"
6161
$env:PYTHONPATH = (Resolve-Path src).Path
62+
$protocolManifest = "<PROTOCOL_MANIFEST>"
63+
$splitPath = "<SPLIT_PATH>"
64+
$seed = <PREDECLARED_SEED>
6265
6366
python -X utf8 -m pytest tests/test_h1_evidence_contract.py -q
64-
python -X utf8 training/ddpm-cifar10/train_ddpm_cifar10.py `
65-
--seed <PREDECLARED_SEED> `
66-
--run-label ddpm-cifar10-corrected-preflight `
67+
python -X utf8 training/ddpm-cifar10/train_ddpm_cifar10_corrected.py `
68+
--protocol-manifest $protocolManifest `
69+
--split-path $splitPath `
70+
--seed $seed `
71+
--run-label "corrected-preflight-s$seed" `
72+
--stop-step 2000 `
73+
--dataset-root $env:DIFFAUDIT_CIFAR10_ROOT `
74+
--num-workers 4 `
75+
--preflight `
6776
--dry-run
6877
```
6978

@@ -80,16 +89,40 @@ Never drop a target after seeing its score because the budget became tight.
8089
Stop preflight on OOM, sustained throughput below 6.0k steps/hour, thermal
8190
throttling, split mismatch, missing row IDs, or resume mismatch.
8291

92+
### Current preflight result (2026-07-12)
93+
94+
- The first frozen batch-64 attempt was stopped before completion: the observed
95+
GPU allocation reached about 7.9 GiB on an 8 GiB device and 2,000 steps had not
96+
completed after about 22 minutes.
97+
- Before any corrected metric was viewed, the single canonical training config
98+
was revised to batch size 32 and the protocol was rebuilt.
99+
- The replacement run used the same first predeclared seed and completed
100+
`0 -> 200 -> 400 -> 2,000`, including two exact-resume launches.
101+
- Active segment time was 583 seconds for 2,000 steps, about 12.3k steps/hour.
102+
Observed peak allocation was about 6.74 GiB during resume, with at least about
103+
1.21 GiB free. The observed maximum temperature was 71 C.
104+
- Checkpoints at steps 200, 400, and 2,000 have matching SHA256 receipts,
105+
protocol identity, training config, seed, and step metadata.
106+
107+
This passes the training portion of Stage 0. Long training is still blocked
108+
until one full checkpoint H1 + PIA evaluation is timed and the protocol-bound H1
109+
activation extractor emits a valid row-bound packet. No corrected AUC or other
110+
membership outcome has been inspected.
111+
83112
## Training Template
84113

85114
Use only values from the frozen protocol manifest:
86115

87116
```powershell
88-
python -u training/ddpm-cifar10/train_ddpm_cifar10.py `
89-
--seed <PREDECLARED_SEED> `
90-
--run-label ddpm-cifar10-corrected-seed<SEED> `
117+
python -u training/ddpm-cifar10/train_ddpm_cifar10_corrected.py `
118+
--protocol-manifest $protocolManifest `
119+
--split-path $splitPath `
120+
--seed $seed `
121+
--run-label "corrected-s$seed" `
91122
--stop-step 100000 `
92-
--log-file training/outputs/ddpm-cifar10-corrected-seed<SEED>/training-100k.log
123+
--dataset-root $env:DIFFAUDIT_CIFAR10_ROOT `
124+
--num-workers 4 `
125+
--log-file "training/outputs/corrected-s$seed/training-100k.log"
93126
```
94127

95128
Never pass `--resume` against `ddpm-cifar10-seed42`, `seed43`, `seed44`,
@@ -98,12 +131,16 @@ Never pass `--resume` against `ddpm-cifar10-seed42`, `seed43`, `seed44`,
98131
If the MATURE branch is selected, resume only after the exact-resume gate:
99132

100133
```powershell
101-
python -u training/ddpm-cifar10/train_ddpm_cifar10.py `
102-
--seed <PREDECLARED_SEED> `
103-
--run-label ddpm-cifar10-corrected-seed<SEED> `
134+
python -u training/ddpm-cifar10/train_ddpm_cifar10_corrected.py `
135+
--protocol-manifest $protocolManifest `
136+
--split-path $splitPath `
137+
--seed $seed `
138+
--run-label "corrected-s$seed" `
104139
--resume 100000 `
105140
--stop-step 200000 `
106-
--log-file training/outputs/ddpm-cifar10-corrected-seed<SEED>/training-200k.log
141+
--dataset-root $env:DIFFAUDIT_CIFAR10_ROOT `
142+
--num-workers 4 `
143+
--log-file "training/outputs/corrected-s$seed/training-200k.log"
107144
```
108145

109146
All targets in the chosen branch must be trained symmetrically. Do not continue
@@ -122,10 +159,25 @@ calibration rows and compute metrics only on the locked evaluation rows.
122159
- Do not report TPR at 0.1% FPR with 512 clean evaluation rows.
123160
- Bootstrap calibration and evaluation rows stratified by class; refit the
124161
attack inside every replicate and use paired row draws across checkpoints.
162+
- Use exactly 1,000 paired bootstrap draws for H1 and PIA. With eight targets
163+
there are 28 pairwise comparisons; 200 plus-one draws cannot make the first
164+
Holm-adjusted p-value smaller than 0.05.
125165
- Run at least 200 full label permutations with attack refitting.
126166
- PIA is the fixed validation attack after its positive-control gate. SecMI is
127167
exploratory unless frozen before any corrected outcome is inspected.
128168

169+
## Outcome-Blind Restart Rule
170+
171+
The first formal Stage 1 launch was stopped at step 22,000 on its first target
172+
after the post-training command audit found an incomplete canonical PIA bridge
173+
and missing complete-roster PIA statistics. No membership outcome was generated
174+
or viewed, and the remaining targets did not start.
175+
176+
That partial target MUST NOT be resumed, scored, or relabeled. After the PIA
177+
repair is committed, rebuild the protocol with the same predeclared seeds and
178+
training matrix, use fresh corrected run labels, repeat the required dry-run and
179+
resource checks, and start every target from step zero.
180+
129181
## Interim Branch Rules
130182

131183
- **STOP** only when both H1 and PIA have AUC 95% upper bounds below 0.55 on

environment.gpu-cu128.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies:
1616
- pre-commit
1717
- pytest
1818
- pyyaml
19-
- scikit-learn
19+
- scikit-learn==1.9.0
2020
- scipy
2121
- xgboost==1.7.3
2222
- seaborn

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies:
1616
- pre-commit
1717
- pytest
1818
- pyyaml
19-
- scikit-learn
19+
- scikit-learn==1.9.0
2020
- scipy
2121
- xgboost==1.7.3
2222
- seaborn

0 commit comments

Comments
 (0)