Skip to content

analog M5b: the M4e converter's 8-conversion trace as an ngspice RAW file that ngspice reads back bit for bit - #11151

Merged
gHashTag merged 2 commits into
masterfrom
lane/m5b-11148
Oct 19, 2026
Merged

gHashTag merged 2 commits into
masterfrom
lane/m5b-11148

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

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):

points variables file largest difference to the spec's doubles
8 time, v(vdp), v(vdn), code binary 0 (0 of 32 differ; the 17-digit print and the rewritten file both agree)
8 time, v(vdp), v(vdn), code ASCII 4 of 32 differ (the time axis), 1 ulp, 1.9e-16 relative; the format holds only 16 digits

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 --check exits 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

claude and others added 2 commits October 20, 2026 03:08
…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
gHashTag enabled auto-merge (squash) October 19, 2026 20:10
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-19 20:11:11 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 48
PRs with All Checks Green 2
READY 2
FAILING 48
PENDING 0
NO CHECKS YET 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=e34e1b174c96 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit 5dc4232 into master Oct 19, 2026
34 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

analog M5b: the M4e converter's trace as an ngspice RAW file that ngspice reads back

2 participants