# The oracle ladder Tiers (family method): 1 hardware-captured, 2 manufacturer documents, 3 hardware-corrected community documents and tests that pass on real hardware, 4 HDL reimplementations, 5 emulators. A low tier is a **detector**, never a **judge**. **There is no tier-1 oracle for the PET's own logic.** No hardware is on hand, no die analysis of the 6520, 6545 or the PET's TTL video is known to us, and the only captures are the few real-machine results quoted in VICE test readmes. The PET is mostly TTL, which makes the schematics (tier 2) unusually strong evidence: a board built gate by gate from SCH-320349 is the specification's backbone, and the chips are judged by their data sheets. ## Per subject: the top tier available | Subject | Top oracle (tier) | What it can decide | What it cannot | | --- | --- | --- | --- | | 6502 | 6502-python's own ladder (perfect6502 netlist: tier 1 for the chip) | every bus cycle of the CPU | nothing PET-specific | | Memory map, decode, I/O wiring | SCH-320349 (2), SCH-8032029 (2), SCH-2001 sheets 2-3 (2) | which chip answers where; which pin goes where | what two drivers on one bus return (U5) | | Open bus | VICE `PET/unconnected`, "results on a 3016" (3) | the last-byte rule, dummy reads | other board types (only a 3016 was measured) | | 6520 PIA | MOS82 6520 pages and its 6-5 note, MC6821 data sheet via williams-python (2) | registers, control lines, flags | timing corners nobody measured | | 6522 VIA | R6522, MOS82 (2); VICE VIA tests via vic20-python (3) | registers, timers, shift register | (in mos6522-python) | | 6545/6845 CRTC | R6545-1, MC6845, MOS82 (2); Fachat's CRTC tests with photographs of a real 8296D's monitor in `CRTC/screenshots` (3); his readme's IRQ-cycle formula (3) | register effects; the screens his 8296D showed | the 6545's status bits timing | | 2001 video timing | SCH-2001 sheet 3, the display circuit's "64 uS" (2) | the structure; the line length | lines per frame (U2) until read off the counters | | CRTC timing per editor | the editor ROMs themselves (run them) (2); PET_CRTC.csv, MAME (5) | the register values software writes | | | Keyboard | SCH-320349 sheet 3 (2) + the editor ROMs | matrix wiring | key-cap layout per keyboard (from the matrix scans, to pin) | | Cassette | SCH-320349 (2), the KERNAL | pins | motor timing (FITTED) | | IEEE-488 | SCH-320349 sheets 2-3 (2), the KERNAL and the DOS ROMs (2, as programs) | the handshake both sides run | electrical timing (not observable to software beyond the KERNAL's timeouts) | | Drives | SM2040, SM2031, DRM (2); MAME (5) | architecture, formats | (each drive board's own ladder) | | Whole machine | MAME 0.285 `pet*`/`cbm*` (5), closed box; VICE xpet (5), not run (GPL: would be built in emu-tools-gpl) | detector: instruction streams, I/O writes, pictures | nothing as judge | ## The gate (proposed) 1. **Unit tests per documented fact**, each citing its sheet or page (decode, pin wiring, reverse video, the character-set line). 2. **Lockstep with MAME's trace as a detector**: the KERNAL's instruction stream from reset by CPU cycle, every difference named. MAME's frames are 62.5 Hz on the CRTC-less drivers and follow the CRTC on the others (mame-oracle.md): compare by cycle, never by frame. 3. **Pictures**: the BASIC banners (MAME snapshots as detectors), then Fachat's CRTC tests against his photographs (judge for the 8296D row only; DO NOT RUN warnings concern real monitors). 4. **Seeded one-line faults**, each caught: a chip select on the wrong address line; PIA1 CB1 edge polarity; reverse video off; the RMW dummy write dropped; the IEEE NDAC/NRFD swap. ## VICE test programs pinned (libsidplayfp mirror `e7aa2aa`) | Folder | What | Tier | | --- | --- | --- | | `PET/unconnected` | open bus reads, with "results on a 3016" in its readme | 3 | | `CRTC/` (crtc0-13, (C) 1999-2006 André Fachat) | CRTC effects, "tested with my european CBM 8296D"; `screenshots/*.jpg` (photographs of a real monitor: `crtc3.jpg` checked, 1280 x 960) and `references/*.png` (emulator output, a detector) | 3 for the photographs | | `PET/keyscan` | keyboard scan | detector (no hardware result stated) | | `PET/hi-res` | the CRTC-less "racing the beam" hi-res trick | detector ("By hacking on VICE"; flicker "on real hardware this is also true") | | `PET/dww`, `PET/hre` | DWW and HRE graphics boards | later expansion rows | | `PET/samples` | sample playback | detector | | `CBM2/` | burn-in disks | the CBM-II, later |