feat(forge): forge/* onto native mlx_job + DELETE Unsloth — this machine forges its own gene (task #52) - #1844
Merged
Conversation
…ine forges its own gene (task #52) The completing pass, LIVE-VERIFIED: a real `forge/train` on this Mac produced a genuine 2.2 MB LoRA adapter (adapters.safetensors + adapter_config.json) via mlx_lm.lora, event-driven, with Unsloth gone. Rewire (modules/forge.rs): - forge/train → native `mlx_job::spawn_train_job` (fire-and-emit): returns a handle IMMEDIATELY, runs the blocking mlx_lm.lora subprocess on spawn_blocking, publishes training → completed/failed over the watch + the airc bus (forge.train.*). ForgeModule now captures the bus in initialize. Non-mlx engine fails loud (grid-peer follow-up) — no Unsloth fallback. - forge/train-status → `current_train_status()` (a READ of the watch, never a poll). - forge/probe → `native_forge_capability()` (observed from the on-disk genome dir + live watch, no gateway). - forge/export else → fail loud (native forges the pageable gguf-lora gene; gguf-lora still via the continuum forge custodian over Contract C, unchanged). - Deleted the dead Unsloth helpers (run_train/build_train_request/run_export/package_format) + their tests; kept the gguf-lora/health/decide tests; added a native-probe test. Excision: DELETED inference/unsloth_control.rs + inference/unsloth_forge.rs (both) + their mod declarations. Zero live importers remained. Genome types already relocated to forge/protocol.rs (#1843). Live proof (cu, after cu reboot): forge/train → handle {phase:training} in ~0s; a failed run (incomplete base dir) → phase:failed with the reason NAMED (silent-break guard); a real run on the complete 4B HF dir → phase:completed, message names the adapter, 2.2 MB adapters.safetensors on disk. Full crate compiles; 23 forge tests + the mlx_job lifecycle test green. Unsloth is not part of this system — we own the models + genome, for real. Follow-ups: mid-run progress streaming (parse mlx stdout), grid-peer RemoteForge (offload to the 5090), the forge.train.done → sentinel page-in over the bus. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
added a commit
that referenced
this pull request
Jul 6, 2026
…rs decls + forge.rs native path (#1845) #1844 shipped the Unsloth file DELETIONS but a git-add pathspec error silently aborted staging the two files that make the deletion compile: this lands them, so canary builds again. - inference/mod.rs: remove `pub mod unsloth_control;` + `pub mod unsloth_forge;` (the deleted modules). - modules/forge.rs: forge/train → native mlx_job::spawn_train_job (fire-and-emit), train-status → current_train_status (watch read), probe → native_forge_capability, export-else → fail-loud; ForgeModule captures the bus; dead Unsloth helpers + tests removed; native-probe test added. This is the code behind the LIVE-verified run (real 2.2 MB LoRA adapter forged via mlx_lm.lora, event-driven). Verified locally: full crate `cargo check` green, 23 forge tests + mlx_job lifecycle test pass, live forge/train → completed with a real adapter on disk. Canary was momentarily broken between #1844 and this; this restores it. Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The completing pass, LIVE-VERIFIED: a real
forge/trainon this Mac produced a genuine 2.2 MB LoRAadapter (adapters.safetensors + adapter_config.json) via mlx_lm.lora, event-driven, with Unsloth gone.
Rewire (modules/forge.rs):
mlx_job::spawn_train_job(fire-and-emit): returns a handle IMMEDIATELY, runs theblocking mlx_lm.lora subprocess on spawn_blocking, publishes training → completed/failed over the watch +
the airc bus (forge.train.*). ForgeModule now captures the bus in initialize. Non-mlx engine fails loud
(grid-peer follow-up) — no Unsloth fallback.
current_train_status()(a READ of the watch, never a poll).native_forge_capability()(observed from the on-disk genome dir + live watch, no gateway).continuum forge custodian over Contract C, unchanged).
kept the gguf-lora/health/decide tests; added a native-probe test.
Excision: DELETED inference/unsloth_control.rs + inference/unsloth_forge.rs (both) + their mod declarations.
Zero live importers remained. Genome types already relocated to forge/protocol.rs (#1843).
Live proof (cu, after cu reboot): forge/train → handle {phase:training} in ~0s; a failed run (incomplete base
dir) → phase:failed with the reason NAMED (silent-break guard); a real run on the complete 4B HF dir →
phase:completed, message names the adapter, 2.2 MB adapters.safetensors on disk. Full crate compiles;
23 forge tests + the mlx_job lifecycle test green.
Unsloth is not part of this system — we own the models + genome, for real. Follow-ups: mid-run progress
streaming (parse mlx stdout), grid-peer RemoteForge (offload to the 5090), the forge.train.done → sentinel
page-in over the bus.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo