12 Commits
Author SHA1 Message Date
Joseph Magly c69348d092 docs: record approved pinned-date Llama baseline measurements 2026-11-28 13:09:06 -05:00
Joseph Magly 90eae790a2 fix(chat-template): catch getattr and alias bypasses and pin operator vLLM kwargs
The completeness guard only flagged x.apply_chat_template(...) calls, so a
getattr call, a getattr or bound-method alias, or functools.partial passed
it. It now flags any apply_chat_template attribute or getattr lookup outside
the helper unless it is passed directly to callable() or hasattr(), and the
two capability probes use that form.

When an operator passes --default-chat-template-kwargs without date_string,
merge the pinned date into that JSON object (operator keys win) instead of
leaving vLLM unpinned. Document that scripts/ stays unpinned, the vLLM
version that first has the flag, that every resolved spec digest changes,
and that older verify-checkpoint references for date templates will not
match the pinned render.
2026-11-27 13:50:44 -05:00
Joseph Magly 7b0022ef2f fix(chat-template): pin the rendered date so prompts do not depend on the wall clock
Templates that call strftime_now (the Llama-3.2 family) rendered the run date into the system header, so stock refusal moved 0.650 -> 0.557 between two days. Every apply_chat_template render in obliteratus/ and app.py goes through obliteratus.chat_template_date, which passes a fixed date_string and strftime_now (default 26 Jul 2024) only to templates that use them. verify-edit takes the date from spec generation.date_string, records it in the report, and appends --default-chat-template-kwargs to vLLM servers it launches; reused endpoints and scripts/ stay unpinned (documented).

Fixes #690
2026-11-27 12:01:21 -05:00
Joseph Magly 521e8111ac fix(process): budget nested cleanup, propagate cleanup failures, hold timed-out leaders
Codex review r1 for #625: the verify-edit step budget now covers both nested
group cleanups (grace plus the bounded post-SIGKILL wait for each), so the
vLLM group is still stopped when the evaluator leader is stuck.
ProcessGroupCleanupError propagates as a distinct failure chained to the
original error (never reported as untested; verify-edit exits 4). Timed-out
leaders are held in a module registry so CPython's Popen cleanup cannot reap
them and reuse the PGID; registry cleanup re-checks ownership through
terminate_group before any signal.
2026-11-24 17:16:38 -05:00
Joseph Magly bb13f0fb6c Merge pull request #576 from elder-plinius/feat/566-resolution-records
Persist checkpoint resolution records
2026-11-19 19:15:34 -05:00
Joseph Magly c10db5abee feat(recipes): persist checkpoint resolution records
Add obliteratus.recipe-resolution/v1: what an applied recipe actually
did, as a canonical record (recipe digest, engine and code commit,
target with structure facts such as tied embeddings, per-step technique
payloads validated by registered techniques, artifacts with digests).
Checkpoints now save recipe-resolution.json atomically beside the
weights. resolution_from_metadata adapts older checkpoints from
abliteration_metadata.json; such records use a fixed created_at
sentinel because the metadata has no timestamp, so their digest depends
on content (bound by the metadata sha256), not on file times. The
random-direction control reads the record when present and records its
digest, and confirmation records the resolution digest.

Fixes #566
2026-11-19 18:54:59 -05:00
Joseph Magly 7c3dcb309e fix(verify-edit): launch vLLM batch-invariant for capability scoring
Greedy, seeded decoding (#562) was not enough: in bf16 vLLM decodes the
same greedy request differently depending on what it is batched with,
so two launches of stock Llama-3.1-8B still disagreed on 4 of 75 arc
items and stock scores moved about 2 points between runs.

The capability endpoint now starts its vLLM server with
VLLM_BATCH_INVARIANT=1 (spec capability.batch_invariant, default true).
Measured with vLLM 0.33 on an RTX 4090: two launches of stock
Qwen2.5-1.5B-Instruct gave identical completions on 150 of 150 arc and
gsm8k items. VllmServer gains an environment argument for server-only
variables; the rest of the environment is preserved.
2026-11-19 18:34:59 -05:00
Joseph Magly 0a90b86fcb fix(verify-edit): score capability with greedy, seeded generation
The capability endpoint ran matric-eval with the provider's default
sampling (vLLM: temperature 1.0); EVAL_SEED only selects samples. Two
runs of stock Llama-3.1-8B-Instruct on the same 75 arc items disagreed
on 4 answers, and per-benchmark stock scores moved 1-3 points between
runs, more than the default 2-point capability margin. In a recipe
search, a gentler edit (higher regularization, lower KL) measured a 5.0
point capability drop against 1.6 for the stronger edit.

The spec's capability endpoint gains temperature (default 0.0) and
generation_seed (default 42), passed to matric-eval run as --temperature
and --generation-seed, so stock and edited are a repeatable paired
comparison on the same items. Null keeps provider-default sampling for
an older matric-eval, which otherwise fails with an actionable reason.
The capability tier may now also be full. The contract test that
rejected tier "full" now uses an unknown tier name.

Requires roctinam/matric-eval#269 for pinned generation.
2026-11-19 16:00:57 -05:00
Joseph Magly 8b39cbfc4d feat(verify-edit): calibrate KL with matched random-direction edits
Stock-vs-stock calibration measures numerical noise: on an RTX 4090 it
suggested KL limits about 100x stricter than the defaults (Llama-3.1-8B
0.0012/0.0087) while a refusal-removing edit measured 1.55/0.37.

verify-edit --calibrate-random --stock S --edited E reads the reference
edit's metadata (final strong layers, effective per-layer ranks,
projection target and EXCISE settings, layer weights, KL-restored
groups), applies K seeded random orthonormal subspaces of the same rank
to the same writers on freshly loaded stock weights (never saving a
checkpoint), and measures first-token and next-token KL on the tune
partition's harmless prompts. The evidence records each trial, the
distribution and suggested limits (multiplier times the chosen
statistic); suggestions are recorded, not adopted.

KL-optimized references are matched by their final static state: their
strong layers already exclude restored layers, and restored global
writers (including tied input embeddings) are left unprojected; the
control never runs KL optimization itself. Edit metadata now records
the projection settings and layer excise weights the control needs, so
older checkpoints must be regenerated to serve as references.

Fixes #560
2026-11-19 15:28:06 -05:00
Joseph Magly 3788e28c12 feat(verify-edit): calibrate per-model margins
Add margin resolution with precedence individual > family > defaults,
validated by the existing spec validator and returned with provenance
for every endpoint field and each input spec's canonical digest. Add
stock noise-floor calibration: stock-vs-stock harmless-prompt KL and
seeded bootstrap intervals over per-prompt rates, written as a
calibration evidence record with suggested thresholds that never fall
below the measured floor. Suggestions are recorded, not adopted; specs
are frozen by digest before final-test confirmation.
verify-edit --calibrate runs it on the protocol tune partition.

Fixes #540
2026-11-19 11:19:17 -05:00
Joseph Magly 3c62b87410 docs: initial core abliteration run runbook
Add docs/INITIAL_CORE_RUN.md: the operator sequence that proves the
core abliteration pathway on a local 24 GB GPU first, then spends one
budget-capped H200 window on Qwen3.8-27B (#531).

- Prerequisites: licences, local pinned revisions, a frozen margins
  spec passed by digest, and extraction prompts exported disjoint from
  the verify-edit held-out set.
- Local steps L1-L6 with exact commands and pass/stop rules: GPU gates
  and campaign dry run, concept gate, obliterate --record-reference with
  verify-checkpoint, verify-edit including the matric-eval vLLM path,
  and the 8B bridge.
- The rented window: the campaign with --budget-usd, --hard-stop-hours,
  --reserve-hours and --elapsed-offset-hours, stop and teardown rules,
  and evidence copy-out.
- Linked from the campaign, verify-edit and checkpoint-verification
  docs; registered in the test-risk map.
2026-11-18 13:00:17 -05:00
Joseph Magly 7fde9afa2c feat(obliterate): verify-edit edited-vs-stock verification stack
Nothing produced a single preregistered pass/fail report for an
abliteration, and there was no glue to matric-eval (#526).

- `obliteratus verify-edit --stock M --edited CKPT --spec SPEC` reports
  pass/fail/untested per endpoint: held-out refusal with Wilson
  intervals, collateral over-refusal and coherence, first- and
  next-token KL on harmless prompts, advisory perplexity, and
  capability.
- Held-out data defaults to the pinned 200-pair final_test partition of
  the qwen38-v1 split; `--write-extraction-pairs` exports its disjoint
  train partition for `obliterate --prompt-pairs-file`, and
  `--extraction-prompts` proves zero overlap (overlap exits 2; unproven
  disjointness leaves held-out refusal untested).
- Margins come from a strict, digest-bound JSON spec
  (obliteratus.verify-edit.spec/v1) with proposed defaults.
- Capability runs matric-eval over vLLM against existing endpoints or
  servers launched from a command template, one model at a time; since
  matric-eval exits 0 on benchmark errors, the run summary is parsed and
  any missing or failed benchmark is untested, never a pass. lm-eval
  reuses capability-check.
- Exit 0 pass, 1 required failure, 3 incomplete (required untested),
  2 usage or integrity error; reports carry model, checkpoint, dataset
  and spec digests and runtime, but no prompt or completion text.
2026-11-18 11:58:46 -05:00