feat: differential fuzzer -- C trainer == GF-T model over random topologies - #1879
Merged
Conversation
…logies The whole-trainer cross-target proof (verify_trainer_c) checked a few chosen nets on a fixed 80-step sequence. fuzz_trainer.py widens it to a randomized space: random topology (1-3 inputs, 1-3 hidden layers width 1-5, 1-3 outputs) x random training inputs with edge values injected (offset-saturation-large 1e5, tiny 1e-9, exact 0/+-1/+-2/+-0.5), cross-checking the C trainer against the Python GF-T model per step. Local deep run: 250 random topologies x 16 steps = 4000 step-comparisons, no divergence; CI runs a 40-topology fuzz (~24s). A mismatch prints a reproducible counterexample. Refactored verify_trainer_c into reusable run_model / run_c (one shared C emission, no drift between the gate and the fuzzer). Verified the fuzzer catches a real divergence (corrupted relu' modf). Refs #1764 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
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 whole-trainer cross-target proof checked a few chosen nets on a fixed sequence.
fuzz_trainer.pywidens it to a randomized space: random topology (1-3 inputs, 1-3 hidden layers of width 1-5, 1-3 outputs) × random training inputs with edge values injected (offset-saturation-large 1e5, tiny 1e-9, exact 0/±1/±2/±0.5), cross-checking the C trainer against the Python GF-T model per step.Local deep run: 250 random topologies × 16 steps = 4000 step-comparisons, edge values injected — no divergence. CI runs a 40-topology fuzz (~24s); a mismatch prints a reproducible counterexample. Refactored verify_trainer_c into reusable
run_model/run_c(one shared C emission). Verified the fuzzer catches a corrupted relu' modf. Refs #1764