Dataset Viewer
The dataset could not be loaded because the splits use different data file formats, which is not supported. Read more about the splits configuration. Click for more details.
Couldn't infer the same data file format for all splits. Got {NamedSplit('train'): (None, {}), NamedSplit('validation'): (None, {}), NamedSplit('test'): ('csv', {})}
Error code:   FileFormatMismatchBetweenSplitsError

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

TSAM MAST signal cache v5

The MAST signal cache that trains and scores the MASTER teacher-student tokenizer on the TokaMark group 1 tasks, and the TokaMark task 1 windows it is scored on. The files are byte-identical to the training inputs. The camera frames of the same shots, on the same time grid, are in a separate folder (master-v5-cameras/, section "Camera frames"); training does not read them.

Use

The code repository is lucas-maes/nuclear (private: ask the authors for access). The cache files are those of commit 9a13b2a, and later commits read them. The camera reader and its database need commit 1c4e9c6 or later (database version 4); the teacher tokens need 1c4e9c6 or later (their meta.json names the architecture and the window).

  1. Get the code at that commit and install it with uv:

    git clone https://github.com/lucas-maes/nuclear && cd nuclear
    git checkout 1c4e9c6
    uv sync
    
  2. From the repository root, download the cache and the TokaMark windows into data/ (about 91 GB; the cameras, the teacher tokens and the checkpoints are left out, see their sections):

    uv run hf download damienscieur/tsam-master-v5 --repo-type dataset --local-dir data --include 'master-v5/*' --include 'tokamark/*'
    
  3. Move the shots out of their split folders. The Hub allows at most 10,000 files in a folder, so the shots are stored as master-v5/shots/<split>/<shot>.bin. The code reads master-v5/shots/<shot>.bin:

    for split in train val test; do mv data/master-v5/shots/$split/*.bin data/master-v5/shots/ && rmdir data/master-v5/shots/$split; done
    
  4. Train (methods/MASTER/README.md gives the options and the cluster workflow):

    uv run python -m methods.MASTER.train_tokenizer --preset champion-fast --cache data/master-v5 --windows data/tokamark --output runs/my-run
    

Layout

Path Content
master-v5/shots/<split>/<shot>.bin 11,188 shots (train 8,963, val 1,115, test 1,110), 42 signals in physical units, each shot whole from its first measurement to its last
master-v5/meta.json The schema, the states, the shots of each split, and the shots without EFIT or without plasma
master-v5/stats.npz Normalization center, scale and count per channel, fitted on the training shots over the plasma window
master-v5/stats_shot.npz The same statistics, fitted on the training shots over the whole shot
master-v5/audit.json The spread of each signal after its transform, and how many values each rule flagged
master-v5/build.json The build settings: the range rule and the signal list
tokamark/task_1-{1,2,3}/{train,val,test}.npz TokaMark task 1 windows, exported by methods.tokamind.export

A shot file holds an 8-byte header length, a JSON header, then one LZ4 block per chunk of 5 ms. Time is counted in ticks of 1 ms from the shot's origin. The origin is chosen so that every EFIT result is on the third tick of a chunk. A block holds, for each signal in schema order, float32 values and then uint8 states, both of shape (samples per chunk, channels). The header gives the shot, its split, its origin, the block offsets, the time of the first sample of each signal, a per-chunk mask of the signals with a value, and the plasma window. The docstring of methods/MASTER/build_cache.py gives the full layout.

The range rules that judge each value alone do not change the stored values: meta.json says "ranges": "loader", and the training loader hides those values (filter nonphysical). The statistics and the chunk masks already leave them out.

Checkpoint

checkpoints/b64-long-v5-2026-11-22/ is a MASTER teacher-student tokenizer trained on this cache (code commit 2853e7c, Rorqual H100, 690,640 steps, batch size 64, two stacked sets). It is the complete run folder:

Path Content
last.pt The weights of both sets at the last step, with the optimizer state
<set>/best.pt The weights of a set at its best validation step
<set>/eval/, <set>/test-last/eval/ The TokaMark group 1 test scores of best.pt and of last.pt
run.json Every launch of the run, with all its options
sets.json, <set>/*.json, metrics.tsv The set order, the architecture and options of each set, the training curve

checkpoints/view-v5-2026-11-22-B/ is the teacher-student run whose frozen teacher (set 0, drop60) made the teacher tokens: Mila, 345,320 steps, batch size 32, sets drop60 and taskpick, the architecture of the champion-fast preset (code commit c97c80a; run.json lists every launch). It is the complete run folder, laid out as above.

TokaMark group 1 test NRMSE of b64-long-v5-2026-11-22/last.pt. Set drop60 (each student input hidden with a probability drawn up to 0.6 per window; a zero-shot model) and set taskpick (the student sees one task's inputs per window):

Set Task 1-1 Task 1-2 Task 1-3 Group 1
drop60 0.1126 0.0351 0.0895 0.0790
taskpick 0.1073 0.0341 0.0864 0.0759

To score it again, check out commit 2853e7c, download the folder into runs/, remove its two <set>/test-last folders (a set that already has one is refused), and run from the repository root:

uv run python -m methods.MASTER.train_tokenizer --cache data/master-v5 --windows data/tokamark \
  --output runs/b64-long-v5-2026-11-22 --fuse step --sets drop60:student_signal_drop=0.6 \
  --sets taskpick:student_view=2 --batch-size 64 --max-steps 690640 --decay-steps 690640 \
  --evaluate --test-checkpoint last

Camera frames

master-v5-cameras/ (about 103 GB) holds every frame of the five MAST cameras (rba, rbb, rbc, rgb, rgc), as 224 x 224 canvases, for the cache shots that have a camera archive, put on the cache's time grid. It is apart from the cache, for a reconstruction task; no training path reads it. To download it only:

uv run hf download damienscieur/tsam-master-v5 --repo-type dataset --local-dir data --include 'master-v5-cameras/*' --include 'master-v5-cameras-preprocessing.json'
Path Content
master-v5-cameras/shots/<shot>.bin 8,388 shots
master-v5-cameras/meta.json The format, the SHA-256 of master-v5/meta.json (the cache it is on), the codec, the shots, the 2,800 cache shots without a camera archive, the 208 archives of shots not in the cache, the frames of each camera inside, before and after the grid, and the views
master-v5-cameras/build.json The build settings
master-v5-cameras-preprocessing.json Per recording, brightness and flags; per turned view, twin and alignment; the documentation of each flag, rule and reader option (section below)

A shot file holds an 8-byte header length, a JSON header, then one Blosc (zstd) block per run of frames in the same 5 ms chunk. For each camera the header gives the dtype, every frame's archive time, the 16 x 16 padding mask of the canvas, the archive attributes, the metadata row, the view id and the blocks (chunk, first frame, count). Each frame is kept unchanged, in the chunk of the grid that holds its time; frames before or after the grid keep their chunk index (below 0, or from the shot's chunk count up). The colour cameras rgb and rgc often record past the cache shot's end, so many of their frames are after the grid (rgc: 426,028 of 1,057,280).

meta.json lists the views (camera, port, lens, orientation, sensor window). The canvas holds the whole sensor at one scale per camera, each window at its sensor position, so the views of one camera and port line up on the canvas; a different port is a different scene.

Clock check: on the first 300 shots (camera rbb only), the frames' brightness correlates above 0.5 with the D-alpha signal of the cache on 258 shots, best at a lag of -0.25 ms (median; quartiles -1.00 and 0.00 ms), that is within one tick. The frame times are not shifted.

The plain reader (methods/MASTER/dataset/camera_reader.py) gives the frames unchanged, with no preprocessing, flags or drop: use it to inspect the files. A model reads CameraFrames (below).

from pathlib import Path
from methods.MASTER.dataset.camera_reader import CameraReader

cameras = CameraReader(Path("data/master-v5-cameras"), cache=Path("data/master-v5"))  # refuses another cache
item = cameras.read(30001, 100, 25, ("rgb", "rgc"))  # every frame in ticks [100, 125)
# item["rgb"]["frames"]: (n, 224, 224) source dtype; ["time"]: (n,) ms from the origin; ["padding"]: (16, 16)

Preprocessing database

master-v5-cameras-preprocessing.json (next to the folder, as data/ expects it) says how to read each recording (a shot and a camera). The camera files stay unchanged; the reader applies it when it reads. Code from commit 1c4e9c6 (methods/MASTER/dataset/camera_preprocessing.py, camera_frames.py; their docstrings say what n = 0 means, how to read frames outside the grid, the frame order and why the brightness scale is per recording). The reader refuses a database of other rules or other documentation: to change a rule, rebuild it (build_camera_preprocessing.py).

  • Per recording: the brightness range (to scale frames to [0, 1]) and flags. A flag describes a recording and drops nothing; the reader leaves a recording out only when asked (drop).
  • Per turned view: its upright twin and the measured flip or rotation. Not trusted: see orientation_unreliable.
  • documentation: why each flag, rule and reader option exists. The tables below are generated from it.
from pathlib import Path
from methods.MASTER.dataset.camera_frames import CameraFrames

frames = CameraFrames(Path("data/master-v5-cameras"), cache=Path("data/master-v5"), drop=("orientation_unreliable",))
item = frames.chunks(30001, 20, 1, ("rbb", "rgc"))  # every frame of grid chunk 20, a variable count
# item["rbb"]["frames"]: (n, 224, 224) float32 in [0, 1]; ["time"]: ms from the start of each frame's chunk;
# ["chunk"], ["content"] (True = image), ["view"], ["flags"], ["setup"] (archive attributes, metadata row)
Flag rba rbb rbc rgb rgc Why
(recordings) 4,976 7,624 2,441 5,983 5,903
empty 0 0 0 0 0 The recording has no frame. Why: the camera file lists the camera for the shot, but no frame was kept. Use: there is nothing to read; the reader gives n = 0.
blank 3 6 20 0 0 The high minus the low percentile (RULES['percentiles']) of the sampled content pixels is under RULES['blank_range'] counts, or the recording has no content pixel: the frames are flat. Why: a camera that recorded no light (shutter closed, no plasma, wrong exposure) still has a recording; a decoder trained on it learns to output a constant. Use: leave it out of training targets.
saturated 607 1,355 231 0 0 More than RULES['saturated_fraction'] of the sampled content pixels are at the maximum value of the depth (2^depth - 1). Why: saturated pixels hide the true brightness; rbb saturates often (the counts per camera are in the database README). Use: keep it if a clipped target is acceptable; leave it out for brightness studies.
rare_view 901 1,252 318 0 0 The recording's view (camera, port, lens, orientation, sensor window) has fewer than RULES['rare_view_recordings'] recordings in the camera files, or the recording has no view (no metadata row). Why: a canvas pixel is the same place in the vessel only within one view; a decoder sees too few examples of a rare view to learn it. Use: leave it out of a model that conditions on the view, or accept it as noise.
orientation_unreliable 512 93 240 0 0 PROBLEMATIC. The recording's orientation label in the camera metadata is not 'none' (flipped, sideways, rotated_180), or the recording has no metadata row, so its orientation is unknown. Why: its stored frames may be upside down or turned against the upright recordings of its camera, and neither the label nor the measured alignment ('views') can be trusted to correct it: a visual check (2026-11-24) found 'flipped' rba, rbb and rbc recordings still upside down as stored, and a measured alignment (rbb view 345) that contradicts it. Use: leave it out wherever one orientation per camera matters, with CameraFrames(drop=('orientation_unreliable',)); the master chose this for the first decoder. Known limit: some recordings labelled 'none' may also be turned; this flag does not catch them.
Reader option Meaning
cache Required. The cache the camera folder was built on; the reader refuses another (its grid).
database This file; default: next to the camera folder, named -preprocessing.json.
drop Flags whose recordings give no frames (n = 0; their view, flags and setup are still given). Default: none. The first decoder uses ('orientation_unreliable',).
merge If True, a recording whose view has a measured alignment is moved (flipped or rotated) onto its upright twin view, and reads as that view. Default: False. Not recommended: the alignments are not trusted (see the 'orientation_unreliable' flag).
Rule Value Meaning
percentiles [25.0, 99.8] Brightness: the low and high percentiles of the sampled content pixels, mapped to 0 and 1.
blank_range 1.0 The 'blank' flag: a recording whose high minus low percentile is under this many counts.
gamma 0.65 Brightness: the curve applied after the percentile scaling (out ** gamma), to show dim plasma.
linear ["rbb"] Cameras scaled linearly from 0 to 2^depth - 1, with no percentile and no gamma (rbb: it saturates, so a percentile scale would hide the saturation).
sample_frames 256 Brightness and flags: at most this many frames, evenly spaced over the recording.
saturated_fraction 0.01 The 'saturated' flag: the share of sampled content pixels at the maximum value.
rare_view_recordings 20 The 'rare_view' flag: views with fewer recordings than this are rare.
mean_frames 64 Alignment: frames averaged into the mean frame of a recording.
pair_shots 1000 Alignment: a view's recording is paired with its twin's nearest recording within this many shots.
max_pairs 20 Alignment: at most this many pairs per view, the closest in shots first.
min_pairs 5 Alignment: no alignment is set with fewer measured pairs.
margin 0.05 Alignment: the best operation's mean correlation must beat the second by this much.
min_correlation 0.6 Alignment: the best operation's mean correlation must reach this.
min_overlap_pixels 1000 Alignment: an operation is measured only if the two mean frames share this many content pixels after it.
twin_min_overlap 0.5 Alignment: a twin view must overlap the view's content by at least this intersection over union, under some operation.

Teacher tokens

teacher-tokens/view-v5-B-drop60/ (121.5 GB) holds the frozen teacher's target tokens for every training window, so that a student can be trained without running the teacher (--teacher-tokens, code from commit 1c4e9c6). The teacher is set 0 (drop60) of the checkpoint checkpoints/view-v5-2026-11-22-B/last.pt (below); meta.json gives its SHA-256, the cache and statistics the tokens were computed on, the architecture, the window, the range rules and the SHA-256 of the window index. Training refuses the tokens with another teacher file or any other of these. The rows were computed with code whose files equal commit 07bde0e; meta.json got the architecture, window and code fields on 2026-11-24, from that code (commit says so). The rows are a float16 array of shape (3,331,715, 95, 192), one row per (EFIT result, offset) pair of the training split.

The Hub refuses files over 50 GB, so rows.npy is stored in 8 parts. Join them and check:

cd data/teacher-tokens/view-v5-B-drop60
cat rows.npy.part-* > rows.npy && rm rows.npy.part-*
sha256sum -c SHA256SUMS --ignore-missing
uv run hf download damienscieur/tsam-master-v5 --repo-type dataset --local-dir data --include 'teacher-tokens/*'
uv run hf download damienscieur/tsam-master-v5 --repo-type dataset --local-dir runs --include 'checkpoints/view-v5-2026-11-22-B/*'
uv run python -m methods.MASTER.train_tokenizer --preset champion-fast --cache data/master-v5 --windows data/tokamark \
  --output runs/my-frozen --teacher runs/checkpoints/view-v5-2026-11-22-B/last.pt --teacher-set 0 \
  --teacher-tokens data/teacher-tokens/view-v5-B-drop60

Training reads the rows at random, so the training shots and the rows (about 216 GB: 75.7 GB and 121.5 GB) should fit in the node's memory; with 128 GB a step was 4.5 times slower than with 320 GB. Row i is item i of Centred(cache, "train", names, fixed=True) (methods/MASTER/dataset/windows.py): its pick(i) gives (shot, input start tick, offset), and the tokens are those of ticks [tick, tick + 5). There are rows for the training split only.

Source and build

The shots come from the MAST archives of lmil/tsam (tokamark/download.py). The cache was built with:

python -m methods.MASTER.build_cache --raw data/raw --output data/master-v5

The camera frames come from cameras-224/ and metadata/camera_metadata.csv of the same dataset, and were put on the grid with:

python -m methods.MASTER.build_cameras --cache data/master-v5 --canvases data/raw-cameras/cameras-224 \
  --metadata data/raw-cameras/metadata/camera_metadata.csv --output data/master-v5-cameras

The cache build also writes scan/ and scan_shot/, the per-shot pieces of the statistics, which it uses to resume. They are not uploaded: no reader opens them, and a rebuild writes them again.

Downloads last month
90