Original FORTRAN II comparison corpus¶
Captured on 20 November 2026. Fourteen new MIT-licensed programs were compiled by the preserved IBM 704 FORTRAN II compiler, rebuilt from pinned rhobbie/Mkf2, and run under both Sim704 and Open SIMH i704. Expected outputs come from those object programs, never from the local runtime.
Offline checks¶
make test # language, SAP/BSS, debug/media, CLI and examples
make test-oracle # 18 harness checks, comparisons, CHM scan and BCD words
make test-oracle-strict # fails on every remaining output discrepancy
Python 3.12+ is needed for oracle tools. Offline checks require no historical sources, emulator, network or .NET. The local runtime remains a C build.
Current result: 26 exact matches, zero allowances and zero failures.
Captured reference outputs are unchanged. The library-grid case covers 25 signed, zero,
interval-boundary and range inputs for each of the six original library
algorithms. An explicit Y=X-X before each call gives the original routine a
known MQ state. All 150 function values match. Uncontrolled incoming MQ can
still change SINF: this grid does not establish arbitrary-context equivalence.
--allow-known remains a harness capability, but corpus.json now contains
no accepted discrepancies. Strict and ordinary checks therefore require the
same exact results. Per-case capture metadata in the manifest records the
later grid capture separately from the unchanged earlier captures.
Ordinary comparison converts CR/CRLF and FF to LF, trims right padding and outer blank lines, and preserves columns/interior blank lines. The dedicated carriage case instead removes only CR, preserving every LF, FF, VT and blank record. It validates blank, 0, +, 1, 2 and slash controls. Configurable carriage tape channels and physical overlapping ink remain outside that test.
Rebuild and capture¶
The bootstrap is for Linux x86_64, Python 3.12+, Git and network access.
It installs a private, checksum-verified .NET 8.0.428 SDK in the cache, builds
the unchanged C# sources using SDK-style projects, extracts UASAP from the
SHARE tape, and executes MKFORT2.cmd and its callees through a restricted
Python batch interpreter. MKUASAP.cmd and the UASAP.cmd assembly routine are transcribed
into Python. This includes the upstream loader patches 8RD=221 and
9LA=221; these are part of UASAP preparation, not changes to the FORTRAN
object programs. Each stage rechecks the source pins, SHARE tape and SDK.
Fresh assembler output and the independently reproduced system-tape hashes
are required before a build is accepted. No Wine, Mono, system .NET installation
or NuGet packages are required. Allow several minutes and roughly 1 GB of
disk space. A second fresh build reproduced both system-tape hashes; tool DLL
hashes can differ with build paths.
python3 tools/oracle_bootstrap.py --cache "$HOME/.cache/fortran-704/oracle-new"
python3 tools/oracle.py capture \
--cache "$HOME/.cache/fortran-704/oracle-new" \
--output /tmp/fortran704-new-capture \
--i704 "/path/to/i704" --record-native-differences
python3 tools/oracle.py check --references /tmp/fortran704-new-capture --allow-known
Use a new cache for a full rebuild and a new output directory for each
capture. Existing system builds and reference directories are never replaced.
--stage prepare|tools|tapes permits inspection between bootstrap stages;
run them in that order. --case NAME selects a corpus case. Omitting --i704 captures only Sim704 and cannot include the Hollerith case,
which requires its native memory witness. It must not be described as a native
witness. Capture rejects a cross-emulator discrepancy unless the explicit
--record-native-differences option is supplied; that option preserves both
outputs and marks DIFFERS, never an agreement.
The bootstrap pins these upstream revisions:
Source |
Commit |
|---|---|
Mkf2 |
|
Sim704 |
|
Tool704 |
|
The SHARE tape has SHA-256
10c32d1a5c070af4cd96272c0841331484f673c46ab88b49df6fc24530656bf7.
Built 4K tape: 3ebd08a77a5883e31df0f3dd329bd2f5e77a8d34ff406e0c313d396a6b95f2fd.
Built 8K tape: 0e730f7b77ea9dd7d2863721f91ab4022fb4e54b8ddf03ad2d5fe613c3a194cb.
The corpus uses the 4K compiler and a 32K object-program machine.
The 8K tape was built but is not exercised by these captures.
Evidence and limits¶
reference/manifest.json records tool/source/tape
hashes, working directories, native binary hash, object hashes and every
capture hash. Offline check verifies source/input hashes, stored capture
hashes and the derivation of .out from raw .printer bytes. The capture
workflow verifies the external tools and tapes; their recorded hashes remain
provenance when those assets are absent from a checkout. .deck.f, compiler listings, XML and console logs show
what ran; all listing source is ours. .gitattributes preserves captured
bytes. Hashes detect accidental staleness; they are not provenance signatures.
Bare END is expanded to END(2,2,2,2,2); this does not test END syntax. Multi-unit compilation enables sense switch 6, then moves the main BSS transfer card after its subprogram decks per C28-6000-2 pages 49-50. No guest instruction is patched. Compilation must reach halt 0035 without diagnostics and produce fresh object cards. Object execution must reach STOP and create fresh printer output. Native i704 breaks at the observed STOP address and verifies IC before quitting, working around its HPR/printer wait; console/script evidence is retained.
Nine cases agree between emulators in nonblank printed lines, preserving
columns and interior field spacing. Five are explicitly DIFFERS: carriage,
boundaries, library, inversion and library-grid. Native i704’s extra blank lines, overprint
behaviour and numerical differences are retained as contrary evidence.
Neither emulator is assumed infallible. Local comparisons use Sim704 output.
The Hollerith native console also examines octal locations 65-77 and verifies 11 complete 36-bit words: ABCDEF, G plus blank padding, digit/sign payloads, and all-ones terminators. Constants are examined as memory as well as sent through binary tape and printed using scalar real/integer dummies. Original FORTRAN array addressing does not walk a literal’s ascending words; the local runtime uses that physical layout too. See the dialect notes.
CHM historical matrix inversion¶
The CHM scan, page 5
contains the 25 one-decimal inverse entries. They were visually transcribed
into chm/scan-values.json. The upstream historical
F2_4K/MatInv.f was compiled and run separately: Sim704 matches 25/25, and
native i704 differs in 24/25. Our independent inversion deck also matches
all scan entries under Sim704 and in the local runtime.
The native-emulator matrix discrepancy’s cause is not established; an older isolated
MQ/FDP probe is not proof of its sole cause.
Only historical output, run logs, script, scan values and manifest are committed in chm/. The historical source, compiler listing and PDF stay outside the repository. Reproduce after bootstrap:
python3 tools/oracle_chm.py capture --cache "$HOME/.cache/fortran-704/oracle-new" --output /tmp/fortran704-chm-new \
--i704 "/path/to/i704"
python3 tools/oracle_chm.py check
The first command captures to a fresh directory; check validates the committed
CHM references and independent inversion capture. The earlier primer evidence
still records 2.99085 in both emulators in primer/.
FORTRAN II serves as an oracle for the common semantics tested under std=1, not original FORTRAN I diagnostics or limits. FORTRAN 0 is specification-based. This corpus measures specific behaviour, not full conformance. Historical sources, SDKs, system cards/tapes and manuals stay outside the repository. The separate SAP corpus includes a small object compiled from our own source.
Current validation and review supersedes the earlier numerical/physical-word status in the preceding milestone and the first-corpus record.