Phase A · neuroscience battery

A6 · Granger causality

cf. Jonas & Kording 2017

← back to the method catalogue

What it does?

Granger causality infers direction from timing. The rule is simple: if the past of signal A helps predict the future of signal B beyond B's own past, then A is said to Granger-cause B. It is widely used in neuroscience and economics to draw directed influence graphs from recorded time series, without any intervention. We apply it to the VCS by treating the CPU, TIA, and RIOT activity as time series and asking which components predict which. The result is a directed graph of inferred influence that we compare to the true data-flow. The appeal is that it turns passive observation into a causal-looking claim. The deep flaw, on this machine, is that it equates 'happens earlier' with 'is the cause'. The VCS is clock-locked, so almost every signal is predictable from almost every other signal one cycle earlier, whether or not there is a real dependency. Granger causality therefore infers edges everywhere. Neither a longer lag nor a stricter threshold repairs this, because the shared clock creates predictability that is not causation. It is the cleanest demonstration in our battery that precedence is not cause, and that only an intervention can tell them apart.

A6 · Granger causality result

Two adjacency matrices over the candidate RAM cells: the true data-flow graph and the graph this method recovered. A bright cell (row = cause, column = effect) is an edge; the difference between the two panels is the error. A6_cell_false_edge_rate_vs_true_dataflow = 1.000 — this example only (pong, state gameplay(seed=0,prefix=90)+15); the audit aggregate is below.

How it's scored

The score is the false-edge rate of the Granger-inferred graph against the true data-flow. We let Granger causality infer directed edges from the timing of CPU, TIA, and RIOT activity, then compare each inferred edge to the true wiring the oracle certifies. An inferred edge that is not real is a false edge, and the false-edge rate counts them; faithfulness is one minus that rate. On the VCS the rate is at or near one, because the machine is clock-locked and almost every signal is predictable from almost every other one cycle earlier. So Granger causality infers edges everywhere, and nearly all of them are spurious. Neither a longer lag nor a stricter threshold repairs this, because the shared clock, not a real dependency, creates the predictability. The grading is always against the intervention oracle, which is the only thing that separates precedence from causation here. There is no sprite-position hard-case for this method; its output is a directed graph. The audit box reports the measured faithfulness across the scored games, and it is among the lowest in the battery, which is the point: timing-based causal inference fails on a machine whose timing is shared.

The score is measured against the §1 intervention oracle — never against another interpretability method. F (faithful) is always vs the oracle; see the execution stack. How each of F / S / M is actually computed for this method (and whether it matches the paper) is in the box just below; the numbers are in the In the audit box under it.

How F, S, M are computed here

The exact formula this method uses for each score, read from its runner, and whether it matches the paper's §3 (F ∧ S ∧ M triad) definition. From the committed audit fsm_math_phaseA.json.

AxisFormula (as computed) What it measuresMatches §3?
F
faithfulness
\(F = F_1^{\mathrm{edge}}(\hat{E}, E^{\star})\)F1 of the Granger-inferred directed edges against the exact-oracle true data-flow graph over 8 candidate cells.✓ matches Graph-valued primitive = edge F1 vs true data-flow graph, matching the paper. Runner A6_granger.jl,; record out/A6_pong.json triad.F=0.0.
how it's measured — call stack:
  1. F = edge-F1 of the Granger-inferred edges vs the true graph — A6_granger.jl:745
  2. _prf: directed-edge precision, recall and F1 — A6_granger.jl:744
  3. true causal effect Δy(u) by bit-exact re-run — oracle_intervene.jl:242
S
sufficiency
\(S = \dfrac{\#\{(i,j):\ \hat{E}_{ij}=E^{\star,\mathrm{held}}_{ij}\}}{\#\,\mathrm{off\text{-}diag}} \in [0,1]\)Directed off-diagonal edge agreement (accuracy) between the Granger graph and the held-out base+37 true data-flow.✓ matches Directed off-diagonal edge agreement between the Granger graph and the held-out base+37 true data-flow: a non-null held-out sufficiency, the [0,1] fraction-within-tolerance special case §3 (sec:triad) admits. A6_granger.jl; record S=0.821.
how it's measured — call stack:
  1. _prf builds the Granger-inferred directed-edge set — A6_granger.jl:744
  2. S = off-diagonal edge agreement vs held-out true edges — A6_granger.jl:755
M
minimality
\(M = |U^{\star}| / |\hat{U}| = |E^{\star}| / |\hat{E}| \in (0,1]\)True-graph directed-edge count over the number of Granger-inferred edges (edge-level |U*|/|U_hat|).✓ matches Runner now emits M = |U*|/|U_hat| over edges (M_note '|true edges|=12 / |discovered edges|=1'), the paper's minimality ratio at the edge level. Record out/A6_pong.json extra.triad.M=1.0. Replaced the former 1 − false-edge rate (edge precision).
how it's measured — call stack:
  1. M = |true edges| / |Granger-inferred edges| — A6_granger.jl:761
  2. _prf counts the true and inferred directed edges — A6_granger.jl:744

✓ matches = the same quantity as §3; ◐ partial = the same kind of estimator but a differing detail; ✗ does not match = a different quantity (see the note). Definitions: F = agreement with the oracle's true causal effects Δy(u); S = held-out predictive score in [−1, 1]; M = |U*|/|Û| (true-minimal-set size / named-set size).

In the audit

This is the method's entry in the actual cross-method audit — scored on the paper's correctness triad, each axis a mean over all 35 scored games (35 committed §R records), not the single example shown above. Tradition: correlational. The example figure (Pong) is one of those records.

0.136F — faithfulness vs oracle (mean over 35 games, ±0.047 CI95)
0.884S — sufficiency: held-out predictive (n/a where the paper does not define this axis)
0.647M — minimality: true-minimal-set / named-set (n/a otherwise)
35committed records aggregated
0.00human-plausibility proxy

F faithfulness (scored vs the oracle for every method) · S sufficiency (held-out predictive score in [−1, 1]; a negative value means the explanation predicts held-out interventions worse than the unperturbed baseline; reported for the predictive methods across all three phases where the calibration/held-out split is defined) · M minimality (true-minimal-set / named-set; where the method names a cause set) — n/a otherwise, per the paper's F ∧ S ∧ M triad.

Source: leaderboard.json · the whole leaderboard is on the methods page and the Paper 2 audit.

Results per game

This method's faithfulness on each of the 35 scored games (all-regime F; this method has no content-vs-position split (see the note below)). Click a header to sort. Every number is read from site_data.json (methods.A6_granger.per_game).

content-F and position-F are n/a for this method. The content-vs-position split applies only to pixel-attribution methods — those that produce an attribution map over the framebuffer, whose score can be read separately on the smooth content outputs and the discrete position outputs (where the naive gradient is provably zero). This method does not attribute to a pixel output; it is graded by its own fidelity metric (A6_cell_false_edge_rate_vs_true_dataflow), reported as the F column, so there is no content or position regime to separate.

M is n/a on 3 of these games. Minimality is M = |U*|/|Û|, the size of the true minimal cause set over the size of the set the method actually names. On a game where the method names nothing (|Û| = 0 — it discovers no circuit, its attribution map is all-zero, or it decodes no cell), that ratio is undefined, so M is left blank rather than scored. The aggregate M is the mean over the 32 games where the method did name a cause set.

GameF (all)content-Fposition-FSMNote
Video Pinball0.500n/an/a0.9521.000
Frostbite0.345n/an/a0.9010.812
Venture0.344n/an/a0.7090.488
Atlantis0.333n/an/a0.9440.500
Phoenix0.333n/an/a0.9700.200
Ice Hockey0.323n/an/a0.8110.550
Double Dunk0.291n/an/a0.6970.375
Bowling0.286n/an/a0.9921.000
Chopper Command0.264n/an/a0.9100.828
Demon Attack0.256n/an/a0.8760.857
Berzerk0.255n/an/a0.8810.719
Montezuma's Revenge0.210n/an/a0.9621.000
Breakout0.200n/an/a0.9311.000
Centipede0.143n/an/a0.8470.273
Carnival0.118n/an/a0.9741.000
Assault0.111n/an/a0.9761.000
Private Eye0.105n/an/a0.9820.900
Tennis0.089n/an/a0.8050.324
Boxing0.083n/an/a0.8181.000
Riverraid0.074n/an/a0.8960.636
Seaquest0.061n/an/a0.9470.737
Road Runner0.037n/an/a0.6600.069no true-cause signal
Q*bert0.012n/an/a0.5600.006no true-cause signal
Air Raid0.000n/an/a0.9290.222no true-cause signal
Alien0.000n/an/a1.000n/ano true-cause signal
Hero0.000n/an/a0.9821.000no true-cause signal
Jamesbond0.000n/an/a0.8530.150no true-cause signal
Kangaroo0.000n/an/a0.995n/ano true-cause signal
Krull0.000n/an/a0.9851.000no true-cause signal
Ms. Pac-Man0.000n/an/a0.7460.261no true-cause signal
Pacman0.000n/an/a0.982n/ano true-cause signal
Pitfall0.000n/an/a0.8920.611no true-cause signal
Pong0.000n/an/a0.8211.000no true-cause signal
Space Invaders0.000n/an/a0.9561.000no true-cause signal
Yars' Revenge0.000n/an/a0.8010.185no true-cause signal

Call stack — how it runs on jutari / jaxtari

The path from this method's runner (compute_game) into the bit-exact VCS substrate, and the computation it involves. Every step links to the exact source on main. From callstack_phaseA.json.

Applied on the substrate

  1. assemble the shared gameplay-state testbed + cause-density gate — build_a6_shared_state(game) -> build_shared_testbed(game; ...) runner
  2. build_shared_testbed definition: booted checkpoint + shared output + gate — function build_shared_testbed(game; ...) runner
  3. cause-density gate counts causes with |Delta_y|>floor via the oracle — cause_density = count(>(floor), deltas) runner
  4. record a (frames x width) RAM tape by stepping the ROM with A6's per-game settings — a6_record_tape(game, frames, actions) runner
  5. step the real emulator one frame per action while recording — env_step!(env, Int(actions[t])) jutari
  6. read RAM into the tape each frame — get_ram(env) jutari

The computation

  1. cell-level Granger causality (method under test): pairwise VAR-based Granger test over candidate-cell series, edge i->j iff G>=tau and p<=alpha (a directed graph) — run_cell_granger(tape, cands; p, granger_tau, alpha) runner
  2. subsystem-level Granger over pooled RAM-region activity time series — run_subsystem_granger(tape; p, granger_tau, ...) runner

Scored against the exact intervention oracle Δy(u): run_intervention(checkpoint, actions, target_frame, horizon, cause).

Implementation
tools/xai_study/phaseA_kording/A6_granger.jl
Reference
cf. Jonas & Kording 2017
Record
A6_pong.json
All records
phaseA_kording/out

The figure is generated from the committed record by docs/gen_method_figures.py; the game frame and each RAM cell's screen footprint are produced by render_scenes.jl / cell_footprints.jl.