Skip to content
This repository was archived by the owner on Jun 4, 2026. It is now read-only.

Add accelerator (HIP) info to system summary and CLI#26

Merged
fantomx42 merged 2 commits into
mainfrom
claude/refine-local-plan-NSoSl
May 29, 2026
Merged

Add accelerator (HIP) info to system summary and CLI#26
fantomx42 merged 2 commits into
mainfrom
claude/refine-local-plan-NSoSl

Conversation

@fantomx42

Copy link
Copy Markdown
Owner

Summary

Extends get_system_summary() to include accelerator (CA-kernel / HIP) availability alongside PyTorch device selection, and enhances the wheeler-info CLI with JSON mode, color support, and clearer output formatting.

Key Changes

  • wheeler_memory/hardware.py: Added accel field to get_system_summary() output containing {"gpu": bool, "gpu_version": int|None}. Falls back gracefully to {"gpu": False, "gpu_version": None} if HIP is not built.

  • scripts/system_info.py:

    • Added --json flag for pure JSON output (no footer, no ANSI) suitable for piping to jq or json.load()
    • Implemented color support with NO_COLOR environment variable and TTY detection
    • Renamed output labels from "Device" to "Embedding device (PyTorch)" and added "CA kernel (HIP)" line to clarify the distinction between PyTorch's device and the CA accelerator
    • Refactored output formatting to use color variables and conditional styling
  • docs/gpu.md: Updated example output and added explanation of the two device lines (embedding vs. CA kernel). Documented --json mode and NO_COLOR support for scripting use cases.

  • docs/api.md: Documented the new accel field in get_system_summary() return value and clarified that optimal_device refers to the PyTorch/embedding device.

  • tests/test_system_info.py (new): Added comprehensive tests covering:

    • get_system_summary() structure and accel field validation
    • CLI JSON mode produces valid JSON without ANSI codes
    • CLI default mode includes footer with proper labels

Implementation Details

The accel field is populated by importing accel_info() from wheeler_memory.accel at runtime. If the import or call fails (e.g., HIP not built), the system gracefully defaults to {"gpu": False, "gpu_version": None}, ensuring shape compatibility across all hosts.

The CLI now distinguishes between two independent device selections:

  • Embedding device (PyTorch): Controls sentence-transformers inference (cuda/mps/cpu)
  • CA kernel (HIP): Controls CA evolution engine dispatch (GPU/CPU)

These can disagree — the most common case on AMD hosts is CPU embedding with GPU CA kernel when HIP is built but PyTorch lacks ROCm support.

https://claude.ai/code/session_014mNYpGjoJ8kK1DXp4SBRDY

claude added 2 commits May 29, 2026 05:03
scripts/system_info.py mixed json.dumps output with a colorized ANSI
footer, so any consumer piping it to jq / json.load choked on trailing
non-JSON. Add argparse with --json (JSON-only, no footer, no ANSI), and
gate ANSI in default mode behind isatty() + NO_COLOR=.

The summary's optimal_device only reflects PyTorch's device selection
(embedding path), which misleads anyone asking "is the engine on GPU?"
when the HIP CA kernel is dispatching. Extend get_system_summary() with
an additive `accel` field sourced from the existing accel_info(), and
have the interactive footer surface BOTH the embedding device and the
CA-kernel device on separate lines.

No rename of optimal_device (external consumers unchanged). Other
JSON-emitting CLIs already follow this --json pattern; system_info was
the outlier.

- wheeler_memory/hardware.py: add accel to get_system_summary
- scripts/system_info.py: argparse + --json + ANSI gating
- docs/api.md, docs/gpu.md: document accel field and --json flag
- tests/test_system_info.py: lock --json purity and footer presence

https://claude.ai/code/session_014mNYpGjoJ8kK1DXp4SBRDY
After the 2026-05-22 per-cell crystallization probe characterized the CA
substrate as synchronous Lyapunov-monotonic descent to a single global
attractor — i.e. textbook Hopfield recall geometry — pin down empirically
whether Wheeler beats the Hopfield baseline its mechanics resemble.

Two side-by-side scripts under scripts/bench/, zero changes to core, engine,
constants, or sacred files. Both reuse existing harness pieces by import
(bench_reconstruction perturbation regime; recall_with_interference path).
Each writes to its own versioned TSV alongside reconstruction.tsv.

Experiment A — substrate (bench_substrate_vs_hopfield.py): same TEST_INPUTS
(α=0.0049), same Gaussian perturbation sweep, same Pearson fidelity ≥ 0.9
recovery threshold. Wheeler CA vs centered-Hebbian Hopfield (bias correction
applied because the attractors are ~77% +1). Pre-registered criterion:
Wheeler capture radius strictly greater than Hopfield's.

  Result: Wheeler ε≤0.50 (55% recovery, 60% spurious) vs Hopfield ε≤1.00
  (100% recovery, 0% spurious). Verdict: FAIL. Caveat per the plan: Wheeler
  is spatially local, Hopfield is all-to-all; the loss is consistent with
  either substrate inferiority or the standard locality tax — the test
  cannot distinguish them at α=0.0049.

Experiment B — SCM-as-waveguide (bench_scm_ablation.py): 10 physics + 10
history facts (hippocampus encoder, intra-class corr ~0.43, cross-class
~0.07), mixed storage, physics-question recall with the full SCM vs SCM
forced to all-zeros + apply_learning=False. Pre-registered criterion:
gap > 0 with bootstrapped 95% CI excluding zero.

  Result: SCM accumulates 0/4096 cells of state during warmup even at
  corruption=0.7 with 3 warmup epochs; both conditions are identical at
  100% recall. Verdict: FAIL_INERT_SCM. The reason is in the code:
  SCMGrid.update_from_recall's cold-start gate requires advantage<0 on
  the first call, but any successful first recall sets kappa_base>0 and
  the gate is closed forever after. The other update channel
  (self_consistency_check) is only invoked by scripts/wheeler_mmlu.py.

Combined reading per the pre-registered outcome matrix: position 2
confirmed — the system is a well-engineered ternary associative memory,
not (on current evidence) a system measurably more capable than Hopfield.
Reconstruction-memory thesis intact; native-CA-intelligence thesis not
supported by these tests. Full writeup of methodology, results, caveats,
and what is/isn't ruled out in docs/reports/substrate-vs-hopfield-2026-05-29.md.

- scripts/bench/bench_substrate_vs_hopfield.py: Experiment A
- scripts/bench/bench_scm_ablation.py: Experiment B
- substrate_comparison.tsv, scm_ablation.tsv: result logs
- docs/reports/substrate-vs-hopfield-2026-05-29.md: methodology + findings

https://claude.ai/code/session_014mNYpGjoJ8kK1DXp4SBRDY
@fantomx42 fantomx42 merged commit 18fbcdd into main May 29, 2026
1 check passed
@fantomx42 fantomx42 deleted the claude/refine-local-plan-NSoSl branch May 29, 2026 13:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants