This guide shows how to run FloppyAI directly from the repository root using the main script, and includes practical examples for all commands.
- Always run from the repository root (the folder that contains
FloppyAI/). - Preferred: direct-run the main script
python FloppyAI/src/main.py --help- Alternate: module syntax also works
python -m FloppyAI.src.main --help- Python 3.9+ recommended
pip install -r requirements.txt- Optional: LM Studio (or compatible OpenAI API server) for
--summarize - Optional: KryoFlux hardware + DTC for read/write flows
- Use
--output-dirto direct outputs to a stable folder; otherwise a timestamped directory undertest_outputs/is created. - Prefer
--profileto set RPM and overlay defaults. Supported:35HD,35DD,525HD,525DD, plus GCR variants35HDGCR,35DDGCR,525DDGCR. - Overlay mode now defaults to
autoand is profile‑driven (GCR profiles pick GCR; others pick MFM). You can still force with--overlay-mode. - Instability visuals are now bright by default (inverted magma colormap with auto‑contrast).
Parse a single KryoFlux .raw and generate basic statistics and plots.
python FloppyAI/src/main.py analyze path\to\file.raw --output-dir .\test_outputs\singleOutputs: <stem>_intervals.png, <stem>_hist.png, and <stem>_heatmap.png (if multi‑rev).
python FloppyAI/src/main.py read <track> <side> [--revs 3] [--simulate] [--analyze] [--output-dir DIR]--simulateavoids real hardware access--analyzeautomatically runsanalyzeon the captured.raw
python FloppyAI/src/main.py write <input.raw> <track> <side> [--simulate] [--output-dir DIR]python FloppyAI/src/main.py generate <track> <side> [--revs 1] [--cell 4000] [--analyze] [--output-dir DIR]- Increase
--revsto fill more revolutions - Reduce
--cell(ns) to raise density
python FloppyAI/src/main.py encode <input.bin> <track> <side> \
[--density 1.0] [--variable] [--revs 1] [--output OUT.raw] [--write] [--simulate] [--analyze] [--output-dir DIR]python FloppyAI/src/main.py decode <input.raw> \
[--density 1.0] [--variable] [--revs 1] [--output out.bin] [--expected orig.bin] [--output-dir DIR]python FloppyAI/src/main.py analyze_disk <dir_or_file> \
[--rpm FLOAT] [--profile 35HD|35DD|35HDGCR|35DDGCR|525HD|525DD|525DDGCR] \
[--format-overlay] [--overlay-mode mfm|gcr|auto] [--angular-bins N] \
[--overlay-sectors-hint INT] [--overlay-alpha F] [--overlay-color HEX] \
[--summarize] [--lm-host HOST[:PORT]] [--lm-model NAME] [--lm-temperature F] \
[--output-dir DIR]- RPM: provide
--rpm, or let--profileset one and bias overlay mode automatically - MFM overlays (PC):
--format-overlay(auto from profile); optional--align-to-sectors autoand--label-sectors - GCR overlays (Mac):
--format-overlay --profile 35DDGCR(auto candidates12,11,10,9,8)
Outputs include surface_map.json, overlay_debug.json, composite and surface PNGs, and an instability summary CSV.
- Bright = angles where the flux transition pattern varies more across revolutions (less repeatable).
- Dark = angles with consistent behavior (more repeatable).
- This is a statistical repeatability map; it is not a decoded data or audio‑waveform view. Format structures (sectors/gaps) and mechanical effects can create wedge‑like patterns without implying synthetic content.
Verification steps:
- Open
surface_map.json:- Per track/side:
analysis.instability_theta(0..1 angular profile),analysis.instability_features, andanalysis.instability_score(scalar). - Check that bright regions in the panel correspond to higher values in
instability_thetafor the same track/angles.
- Per track/side:
- See the concept page for details: docs/instability.md
python FloppyAI/src/main.py analyze_corpus <root_or_map.json> \
[--generate-missing] [--rpm FLOAT] [--profile 35HD|35DD|35HDGCR|35DDGCR|525HD|525DD|525DDGCR] \
[--format-overlay] [--overlay-mode mfm|gcr|auto] [--angular-bins N] [--overlay-sectors-hint INT] \
[--overlay-alpha F] [--overlay-color HEX] \
[--summarize] [--lm-host HOST[:PORT]] [--lm-model NAME] [--lm-temperature F] \
[--output-dir DIR]- With
--generate-missing, the tool will first runanalyze_diskon directories that contain.rawfiles but nosurface_map.jsonand then aggregate - Writes
corpus_inputs.txtandcorpus_missing_inputs.txtfor transparency
python FloppyAI/src/main.py compare_reads <path_or_dir1> <path_or_dir2> [<...>] [--output-dir DIR]- Each argument may be a
surface_map.jsonpath or a directory containing it - Outputs
diff/diff_summary.jsonanddiff/diff_densities.csv
python FloppyAI/src/main.py classify_surface <surface_map.json> [--blank-density-thresh 1000] [--output-dir DIR]python FloppyAI/src/main.py plan_pool <surface_map.json> [--min-density 2000] [--top-percent 0.2] [--output-dir DIR]When KryoFlux DTC hardware is attached to a Linux host that requires sudo, do not attempt to orchestrate DTC from Windows. Use a manual, script-based flow on Linux and analyze on Windows.
Recommended steps:
- Generate streams on Windows with FloppyAI (you can test with
--simulatefirst):python FloppyAI/src/main.py generate 80 0 --revs 1 --density 1.2 --pattern prbs7 --output-dir .\test_outputs\to_linux
- Transfer the generated
.rawfile(s) to the Linux DTC host (USB/share/etc.). - On Linux, run your bash script(s) to write and then read back captures with dtc (sudo as needed). For example:
# Example only; adapt to your environment sudo dtc -d 0 -i 0 -t 80 -s 0 -f /path/to/generated.raw write sudo dtc -d 0 -i 0 -t 80 -s 0 -r 3 -f /path/to/captured_80_0.raw read
- Transfer captured
.rawback to Windows and analyze:python FloppyAI/src/main.py analyze path\to\captured_80_0.raw --output-dir .\test_outputs\captures
Notes:
read/writeCLI commands in this repo assume local DTC availability; on Windows, prefer--simulateor use them only if you have local DTC.- Cross‑machine orchestration (e.g., SSH) is intentionally out of scope.
- The overlay block is saved in
surface_map.jsonunderglobal.insights.overlayand per‑track under<track>.overlay. - If confidence is weak, the tool falls back to either profile defaults, your
--overlay-sectors-hint, or the median per‑track sector count. - Increase
--angular-binsfor finer phase resolution; tune--overlay-colorand--overlay-alphafor visibility.
-
Compare reads says it found no
surface_map.json:- Run
analyze_diskfor each read first (pointing to the read directory), then re-runcompare_readsusing those run output folders or the direct JSON paths.
- Run
-
Module cannot be found:
- Ensure you run commands from the repository root with
python -m FloppyAI.src.main ....
- Ensure you run commands from the repository root with