Repository navigation
C training-IO: seeded RNG, spike encoders, IDX loader, checkpoints, reverse bridge - #37
Merged
Merged
Conversation
Closes #27, closes #28, closes #29, closes #30. - src/rng: splitmix64 seeded RNG, portable C11, fixed test vectors. - src/encode: rate/latency (linear+log)/delta/random/repeat codings ported from SpikeEncoder/spikegen semantics; goldens from the stdlib-only tools/encode_golden.py, bit-exact in test_encode. - src/data: IDX MNIST reader with v/255 normalization matching the torch transform; tiny committed fixtures from tools/make_mnist_fixture.py. - src/checkpoint: JSON writer, version-stamped spikeforge-c-checkpoint v1 save/load, weight get/set accessors, and graph_summary export for the reverse bridge; tools/patch_nir_weights.py merges a checkpoint into a Python-side summary. Tests: 34/34 ctest pass, including test_rng, test_encode, test_data, test_checkpoint; ASan/UBSan build also 34/34.
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.
Closes #27, closes #28, closes #29, closes #30 (one PR for the tight cluster; checkpoint feeds the bridge, RNG feeds the encoders). All four verified live against origin/master e1bb03d before coding: no src/data., src/rng., src/encode., src/checkpoint. exist, json.h is parse-only, and graph weights have no setter API.
What
Only new files plus 8 lines of CMake/test registration. No edits to existing src/*.c.
Tests
34/34 ctest pass (new: test_rng, test_encode, test_data, test_checkpoint); ASan/UBSan build also 34/34. Goldens are stdlib-only generators (tools/encode_golden.py, tools/make_mnist_fixture.py) with committed fixtures, so just test needs no Python. E2E checked: C perturb -> checkpoint -> patch script output == C export bit-exact -> reloads in nir_graph_load.
Follow-ups (not in this PR)