460 Commits
Author SHA1 Message Date
Joseph Magly 0ca0d1d77e feat(gguf): add native GGUF toolkit
Add bounded GGUF v2/v3 parsing, transactional metadata and tensor edits,
split-file handling, provenance manifests, exact GGML storage typing, and
measurement-gated quantization planning. Preserve unmodified payloads
byte-for-byte and expose the toolkit through `obliteratus gguf`.

Verification:
- 57 focused tests on each of Python 3.11, 3.12, and 3.14.
- 377 combined focused, CLI, risk-map, CI-policy, package-export, and
  CLI-boundary tests on Python 3.14.
- 2,000 randomized exact-DP comparisons against brute force.
- Real single-file and three-shard GGUF metadata edits with tensor hashes
  preserved; independent GGUF reader opened every output.
- Ruff, risk-map validation, wheel/sdist build, and isolated wheel CLI smoke.

No real Qwen4 conversion or inference was run; runtime and quality
qualification remain separate gates.
2026-12-04 18:35:28 -05:00
Joseph Magly d198f8f399 Merge pull request #781 from jmagly/feat/offline-shard-editor-quant
Add FP8/MXFP4 quantized offline shard editing and requantization
2026-12-03 19:14:42 -05:00
Joseph Magly 264571313a ci(policy): own a duration budget for test_length_confound_matches_the_candidate_and_is_flagged 2026-12-03 19:06:20 -05:00
Joseph Magly 8fc4e7ab07 Merge remote-tracking branch 'upstream/main' into HEAD 2026-12-03 19:06:19 -05:00
Joseph Magly 99158b71ac Merge pull request #775 from jmagly/feat/offline-shard-edit
Add an offline safetensors shard editor for direction projection
2026-12-03 19:02:32 -05:00
Joseph Magly 3302dc3b29 fix(ci): map requantize.py in test-risk-map and drop unused variable 2026-12-03 18:59:33 -05:00
Joseph Magly 7685f6a0c6 chore(ci): place the shard editor risk entry clear of concurrent additions 2026-12-02 08:37:02 -05:00
Joseph Magly bb389f5830 feat(offline-edit): streaming safetensors shard editor for refusal-direction projection
Shard-at-a-time output-side projection W <- W - s r (r^T W) (row-space for embeddings) in float32,
cast back to the source dtype; orientation verified from shapes; quantized (U8/MXFP4) tensors refused.
Writes a new checkpoint: edited shards rewritten in original tensor order and metadata, untouched shards
hard-linked (copy fallback), non-shard files copied, edit_manifest.json with per-key norms and projection
norms before/after, resumable progress bound to source and directions hashes. Dry-run lists matches.
Entry point: python -m obliteratus.offline_edit.
2026-12-02 08:36:58 -05:00
Joseph Magly af52ebf547 feat(directions): refusal directions from external engine capture artifacts
Validates the obliteratus.engine_capture.v1 artifact (schema, digest, shapes, finite values, positive
counts), computes per-row difference-in-means directions in float64 without loading a model, selects
rows (explicit, top-k, min strength; layer 0 excluded by default) and writes obliteratus.directions.v1
with manifest-bound provenance. Normalized captures (representation attn_input_normalized, e.g. the
RMSNorm-ed attention input of AttnRes models such as Kimi-K3.1) carry norm_weight and are mapped back
to residual space by dividing by it. Entry point: python -m obliteratus.external_directions.
2026-12-02 08:36:54 -05:00
Joseph Magly 03b70f01e4 feat(capture): capture normalized attention inputs from a vLLM engine
Adds a vLLM worker extension and driver that record the last-token attention input per layer. Tensors cross the engine RPC as explicit dtype, shape and bytes, because vLLM's untyped msgpack decode does not restore them.
2026-12-02 08:36:52 -05:00
Joseph Magly 85a2a359f4 Test tiny DeepSeek and Kimi fixtures through production discovery 2026-12-01 06:32:34 -05:00
Joseph Magly 5048915045 ci: renew five no-support waivers through December 14 2026-12-01 05:53:08 -05:00
faber a02ccd5d4d fix(gguf_cot_knob): register in test-risk-map and avoid unused-slot W_E false positives 2026-11-30 10:34:48 -05:00
Joseph Magly c5bdc5e07f Merge current main and preserve fresh export inventory checks 2026-11-29 20:14:27 -05:00
Joseph Magly 192994397e test(typing): enforce static export uniqueness and scoped consumer CI 2026-11-28 16:20:45 -05:00
Joseph Magly a0eae4ea1b Merge main into test/287-offline-fault-cases
# Conflicts:
#	ci/test-risk-map.json
2026-11-28 15:40:01 -05:00
Joseph Magly a1ebb7a65b test: preserve custom Gloo workers and select dependent callers 2026-11-28 15:01:42 -05:00
Joseph Magly 3b535c0b73 fix: bind observation to signed source and handle publication failures 2026-11-28 14:32:52 -05:00
Joseph Magly 2b0a53e0b6 feat(distributed): collect observation-only rank-local review inputs 2026-11-28 13:07:24 -05:00
Joseph Magly 7a7bc94086 Merge main 0168897 into feat/427-identity-security-eval
Resolve ci/test-quality-policy.json by keeping both owned slow-test
budgets: the E4 Gloo agreement test from #698 and the CLI dispatch help
test from this PR.
2026-11-27 16:57:31 -05:00
Joseph Magly 03964fe0ca Merge main cd7ae6c into feat/287-e4-workload-and-probe-ram
# Conflicts:
#	CHANGELOG.md
2026-11-27 16:18:20 -05:00
Joseph Magly e9f81ea8e2 Merge main cd7ae6c into feat/427-identity-security-eval 2026-11-27 16:04:15 -05:00
Joseph Magly cea3843926 ci(policy): own a duration budget for the first CLI dispatch help test
On this PR's shard layout, tests.test_cli.TestCLIDispatch::
test_verification_help_explains_invalid_denominator is the first CLI
dispatch test in its worker and pays the cold CLI import: 20.6 s and
16.3 s on hosted runners against about 3.5 s locally (unchanged by this
PR; the identity-security CLI module imports in 12 ms). It failed the
15 s default twice, so it gets an owned 25 s budget.
2026-11-27 16:04:13 -05:00
Joseph Magly cd7ae6ca9f Merge pull request #700 from elder-plinius/feat/accept-nov21-recipes
feat(recipes): accept nine recipes confirmed in the 2026-11-21 validation run
2026-11-27 16:02:48 -05:00
Joseph Magly f9c0c72fc4 Merge main 56cfa4e into feat/accept-nov21-recipes
# Conflicts:
#	CHANGELOG.md
2026-11-27 15:39:48 -05:00
Joseph Magly 26a7b45b08 Merge main 56cfa4e into feat/287-e4-workload-and-probe-ram
# Conflicts:
#	CHANGELOG.md
2026-11-27 15:37:56 -05:00
Joseph Magly 34cff6c1a5 Merge main 56cfa4e into fix/689-batched-vocab-discovery
Resolve the vocab_surgery_discovery.py conflict with #699: keep the batched
discovery structure, render discovery prompts through the pinned-date
chat-template helper, and record chat_template_date in the generation block.
2026-11-27 15:33:56 -05:00
Joseph Magly ee756af22c Merge main 03cd1f2 into fix/689-batched-vocab-discovery
# Conflicts:
#	CHANGELOG.md
2026-11-27 14:46:25 -05:00
Joseph Magly d8bc2ac3c8 ci(policy): own a duration budget for the first E4 Gloo agreement test
The first two-rank Gloo test in the E4 module pays the cold torch import in
both spawned ranks and took 15.5 s on the hosted PR runner, above the 15 s
default (about 5 s locally). Give it an owned 25 s budget, matching the
other two-rank Gloo tests.
2026-11-27 14:28:20 -05:00
Joseph Magly c1878b6cf6 Merge main d0ceadd into feat/427-identity-security-eval 2026-11-27 14:06:57 -05:00
Joseph Magly ae85e60814 Merge main d0ceadd into feat/accept-nov21-recipes 2026-11-27 13:51:52 -05:00
Joseph Magly 966ab62b46 feat(recipes): accept nine recipes confirmed in the 2026-11-21 validation run
Ship as accepted v2 data the nine recipes that passed the protocol final
test and were accepted by the operator on 2026-11-27: Granite 4.1 8B,
Llama-3.2-1B, Llama-3.2-3B, OLMoE-1B-7B, Phi-4-mini, Qwen3.5-0.8B,
Qwen3.5-9B, Llama-3.1-8B-Instruct-abliterated and DeepSeek-R1-Distill-
Qwen-7B. Each ships a KL-advisory evaluation profile and value-only
confirmation and verify-edit evidence bound by SHA-256, following the two
recipes accepted in 134bd2c.

The Llama-3.2 results predate the chat-template date pin (#690) and are not
comparable with later measurements. Two recipes were confirmed with
analysis_device auto (resolved to cuda:0) and ship as confirmed; the shipped
CPU-extraction test now names them explicitly.
2026-11-27 13:51:50 -05:00
Joseph Magly 8c5c749757 Merge main d0ceadd into feat/287-e4-workload-and-probe-ram 2026-11-27 13:51:16 -05:00
Joseph Magly 79be989671 Merge main d0ceadd into fix/690-pin-chat-template-date 2026-11-27 13:50:46 -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 afde716070 feat(distributed): add rank-local LMS-E4 workload admission and a streaming reference
Adds the two-host E4 workload path. A bounded streaming reference is built from the immutable source with one layer resident at a time, so it works for models larger than any single host. run_rank_local_qualification.py admits a fully bound E4 job only when its workload exceeds the local host's physical RAM, and the worker requires both ranks to agree over Gloo before PROBE. Registry and final qualification checks are unchanged; the stack stays not_qualified. The PROBE RAM refresh was already delivered in 002e6e5.

Refs #287
2026-11-27 11:23:49 -05:00
Joseph Magly 08a33ff9df feat(research): add an opt-in identity-conditioned code-security evaluation
Adds 'obliteratus identity-security', an opt-in research evaluation excluded from every default gate: identity-only paired prompts with commit-pinned generation settings, generated apps run only in a fail-closed, no-network Bubblewrap sandbox with resource limits, functional checks and executable exploits scored separately, and denominators, exclusions, intervals, Fisher/McNemar tests and Holm adjustment reported. Paired activation capture reuses capture_activations. Real-sandbox tests live in tests/conditional/; third-party results are documented as unverified claims. The weight-intervention arm is a follow-up.

Refs #427
2026-11-27 11:23:41 -05:00
Joseph Magly 301f4d1edc fix(admission): estimate the FLA/causal-conv1d recurrent workspace for Qwen hybrid models
Phase admission gives a conservative estimated workspace for the exact FLA 0.5.2 chunk scan and causal-conv1d 1.7.0 forwards that Transformers selects for Qwen3-Next/3.5/3.8 hybrid models, after verifying package versions, wrapper chains back to the module's own file and FLA's alternative backends without importing anything. The estimate counts every inventoried kernel allocation at FP32 width, never drops below the torch-fallback estimate and adds 512 MiB per device. It is estimated, not calibrated: fail-closed still refuses; other compiled paths stay unknown.

Refs #384
2026-11-27 11:23:33 -05:00
Joseph Magly 1aded15678 perf(vocab-surgery): batch greedy generation in discover (--batch-size)
Discovery generates prompts in left-padded greedy batches with explicit attention masks (--batch-size, default 8). Each row is cut at its first stop token, matching the unbatched call. Responses, counts, scores, ranking and prompt_audit (per-prompt input_ids, rendered digests, chat-template digest) are identical to --batch-size 1, which keeps the original path byte-for-byte. CPU tests on tiny GPT-2 and Llama models cover EOS and varied prompt lengths.

Fixes #689
2026-11-26 17:29:40 -05:00
Joseph Magly 8fee1f4241 ci(policy): derive owned duration budgets from the slowest of all hosted samples
Grok review r1 for #685: the concept_pack budget (65 s) came from one sample
of a heap-sensitive test and was already exceeded (83.89 s). Owned budgets
are re-derived from the slowest of all five hosted release samples
(45678651612 both lanes; 45696135376 py3.11 head, py3.12 head and base):
concept_pack 105 s and recipe_application v2 35 s, the rest unchanged.
smaller_change low_variance and failing_collateral are owned at 20 s. The
CONTRIBUTING owned-tests section covers all 24 and states the rule.
2026-11-25 16:20:47 -05:00
Joseph Magly 51fa9e2213 ci(policy): rebaseline release duration budgets, speed up slow tests, enforce per-test budgets on PRs
Rebaselines the release suite and marker duration budgets to the slowest
measured hosted release time + 25% (run 45678651612; suite 3910 s on py3.11
and 5340 s on py3.12; cpu 2010, integration 700, unmarked 2460) and owns every
test whose time + 25% exceeds 15 s under #679 with a 90-day review (follow-up
#684). Speeds up test_smaller_change rank1 (geometry environments built lazily)
and the recipe-search fake edit step (a light helper module). The PR core gate
now enforces per-test budgets on each shard's JUnit with a new
--testcase-budgets-only mode; suite and marker totals stay release-only.

Refs #679
2026-11-25 15:33:27 -05:00
Joseph Magly 8bdd844e09 fix(handles): clean up remaining ModelHandle sites and name the snapshot path once
Section D of #675: the neuron lab's load() drops the previous handle and its
state even when its cleanup fails (the failure is raised and nothing new is
loaded); `experiments trace` cleans up its handle on success and failure
without masking the trace error; default_model_factory cleans up the handle
when .to(device) fails, keeping the move error; a snapshot error raised
through a handle names the restore-point path once. Adds tests for the
sequence refusal branch and write_step(changed=False), and registers the
cleanup-site tests for inputs.py and trace_cli.py in the risk map.

Refs #675
2026-11-25 13:45:14 -05:00
Joseph Magly 3c7a6ca920 fix(models): harden ModelHandle cleanup sites and messages
Moves cleanup_on_exit/cleanup_during_error to the light
obliteratus.handle_cleanup module (re-exported from the loader) and imports
them at module top, so no import runs after a handle exists. Stores the closed
policy before detaching the restore point, names the path to remove in
handle-surfaced SnapshotErrors, guards post-load work in candidate,
smaller_change and the sequence loaders, keeps observer-close and neuron-lab
cleanup failures from replacing the primary error or skipping state reset, and
adds failure-plus-failing-close tests for every listed site.

Fixes #669
2026-11-25 10:06:29 -05:00
Joseph Magly 17b2ae36bd fix(strategies): resolve Gemma 3 multimodal decoder layers and hint bfloat16 on fp16 baseline overflow
Gemma 3 4B/12B/27B checkpoints load as Gemma3ForConditionalGeneration with the
text decoder at model.language_model.layers; get_layer_modules now falls back
to that path (model.layers stays primary), and text-only gemma3_text is mapped
explicitly. A non-finite stock baseline on float16 weights now suggests
--dtype bfloat16. The default dtype is unchanged.

Fixes #643
2026-11-25 02:37:29 -05:00
Joseph Magly f2abf5557a fix(viewer,report): share one numeric-string grammar and read metrics in file order
Codex review r2 for #618: the results viewer reads uploaded files with an
order-preserving JSON reader so metric selection walks baseline keys in file
order like Python (integer-like keys included), and the viewer and
report._metric_value share one strict numeric-string grammar (ASCII digits,
sign, decimal point, exponent; ASCII whitespace only; finite).
2026-11-24 19:13:22 -05:00
Joseph Magly 86407c7760 fix(viewer,report): render results as text, mirror plot metric selection, write plots atomically
Codex review r1 for #618: the results viewer builds its stats, chart and
table with DOM nodes and text only (no innerHTML), so a crafted results.json
cannot inject markup; its impact-metric selection mirrors save_plots exactly
(string primary only, measured baseline plus at least one measured ablation);
every render clears all result regions. Plots are written to a temp file and
moved into place only on success, figures are always closed, and a fallback
metric is labelled on the chart. A node-based test exercises the viewer.
2026-11-24 18:31:18 -05:00
Joseph Magly 16f181a578 Merge pull request #605 from elder-plinius/feat/590-analysis-on-device
Run abliteration analysis math on the model's device
2026-11-24 15:36:12 -05:00
Joseph Magly 2d79987f9b Merge remote-tracking branch 'upstream/main' into fix/589-search-process-groups 2026-11-23 12:21:30 -05:00
Joseph Magly f2db169384 Merge upstream/main into feat/590-analysis-on-device
Resolve against #593 (quick-check settings) and #591 (tied-head
migration) by keeping both sides: the pipeline gains analysis_device
alongside refusal_check_mode/confidence; migration and the shipped
recipes emit allow_tied_head_edit and the analysis_device cpu pin;
_structured relaxes both the refusal-check settings and
analysis_device for historical resolution records; both sides' tests
are kept.
2026-11-23 12:20:52 -05:00
Joseph Magly d62f4aafe9 feat(abliterate): run analysis math on the model's device
When the model is on CUDA or MPS, activation stacks and the analysis
math (difference means, winsorizing, whitening, per-layer SVD in
float32, refinement and KL logits) now stay on that device instead of
being copied to the host, where they used about 10 host cores per edit.
A new analysis_device setting (auto | model | cpu) is a v2 projection
parameter: auto, the default for v2 recipes, uses the model's device and
falls back to the CPU with a logged reason for offloaded, split or meta
models or when the pre-collection memory estimate exceeds free device
memory. The device actually used is recorded in resolution records and
checkpoint metadata. v1-migrated recipes and the shipped recipes pin
cpu so confirmations made with CPU-extracted directions re-apply
exactly; direct pipeline calls keep their CPU default. CPU results are
unchanged.

Fixes #590
2026-11-23 12:19:09 -05:00