Repository navigation
analog M5b: the M4e converter's 8-conversion trace as an ngspice RAW file that ngspice reads back bit for bit - #11151
Merged
Merged
Conversation
…file that ngspice reads back bit for bit -- sar_trace_raw.t27 (Closes #11148) specs/analog/sar_trace_raw.t27 runs the converter of sar_adc.t27 (its functions come in with use, none is copied) for 8 conversions of the fitted model, whose codes equal ngspice's NG_CODE on all 8, builds the trace (time, v(vdp), v(vdn), code) and has raw_writer.t27 write it, binary and ASCII. Both files are pinned in the spec (hex and text) and the tests assert that the writer's bytes equal them; the read-back decodes the pinned hex out of the spec text, so a byte the test pins is a byte ngspice reads. trace_readback reads a file through raw_check and compares every double with the trace by bit pattern, reporting the count, the first point and variable, and the largest difference. specs/analog/decks/sar_trace_raw.cir is the deck of the read-back (load, print, write back). No hand-written program is added: the files ngspice loads are decoded from the spec's constants. Read-back, ngspice-47 in a container on the remote host: points variables file largest difference to the spec's doubles 8 time v(vdp) v(vdn) code binary 0 (0 of 32 differ; print with 17 digits and the rewritten file agree) 8 time v(vdp) v(vdn) code ASCII 4 of 32 differ (the time axis), 1 ulp, 1.9e-16 relative: %.15e holds 16 digits Negative controls, each in the spec: every one of the 256 data bytes flipped (lowest and highest bit) is a file the header checks accept and the reader reports at its point and variable; a header with 9, 7 points or 5 variables is refused (short, trailing, variables); a trace of the broken converter (no parasitic, no offset) differs in all 8 codes. ngspice loads the changed byte and prints the changed value, and refuses the 9-point header ("bad rawfile", "no data read"). Four mutants of the spec (sample instant, a blind reader, a wrong type, a Command line) each fail. Tests: 7, 0 fail, 0 vacuous (t27c test-report); t27b test --check exit 0. Closes #11148 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…file that ngspice reads back bit for bit (Closes #11148) Merge of master plus sealing, gates run on the merged tree with t27c from master: tests clean with vacuous passes 0, seal --verify MATCH, tri types ratchet CLEAN, dupe_scan failure set a subset of master's. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
October 19, 2026 20:10
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.
Closes #11148
analog M5b: the M4e converter's 8-conversion trace as an ngspice RAW file that ngspice reads back bit for bit
Gates run on the merged tree (t27c from master): 3 spec(s) with tests clean and vacuous passes 0, seal --verify MATCH, tri types ratchet CLEAN, dupe_scan failure set a subset of master's (inherited red).
TEST specs/analog/sar_trace_raw.t27 tests=[7] fail=[0] vacuous=[0]
TEST specs/analog/raw_writer.t27 tests=[18] fail=[0] vacuous=[0]
TEST specs/analog/sar_adc.t27 tests=[15] fail=[0] vacuous=[0]
SEAL specs/analog/sar_trace_raw.t27 :: all hashes MATCH
SEAL specs/analog/raw_writer.t27 :: all hashes MATCH
SEAL specs/analog/sar_adc.t27 :: all hashes MATCH
TYPES RATCHET: CLEAN
DUPE failing=0 extra-vs-master=[]
Read-back by ngspice-47 (one container, 2 threads; the deck loads the file, prints with
numdgt=16, writes it back as binary):The model's codes equal ngspice's on all 8 conversions (the fitted converter, as in M4e). Negative controls: every flipped data byte (256 bytes, lowest and highest bit) is reported by point and variable by the spec's reader; a header with 9 or 7 points or 5 variables is refused; the trace of the broken converter differs in all 8 codes (largest difference 12); ngspice agrees: the flipped-byte file reads back 1.0969568675999999 where the pinned file gives 1.0969568676000001, and the 9-point header is refused with "bad rawfile, point 8, var time, load aborted". Four mutants of the spec each fail.
t27b test --checkexits 0 with no mismatch. Only the binary file is read back for equality; the ASCII file is pinned text plus a reader check.🤖 Generated with Claude Code