Skip to content

feat(scope): decode WPILib structs, range parquet, freeze SPL transform - #30

Merged
rylero merged 1 commit into
mainfrom
feat/scope-struct-decode-parquet-range
Jul 13, 2026
Merged

rylero merged 1 commit into
mainfrom
feat/scope-struct-decode-parquet-range

Conversation

@rylero

@rylero rylero commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Why

Acting on the strategic question raised against USABILITY_FRICTION.md: is the SPL pipe language worth its cost? Split the answer — SPL is two things wearing one coat:

  • Access verbs (get/range/find-bool/find-threshold/stats/set/connect) — thin, correct, valuable. Keep.
  • Transform engine (eval/where/timechart/rex/stats-by, ~3k LOC) — reimplements pandas/SQL; both 🔴 blockers (F1 abs(nil), F2 !=0 null leak) and the token-cost findings (F10/F11/F12) live here.

Decision: freeze the transform engine and lean on cs → parquet → pandas for transforms (correct null handling + numeric formatting for free, near-zero response token cost). This PR does that and closes the highest-value telemetry gap.

What

  • F17 — WPILib struct decoding (highest-value gap). struct: fields no longer return opaque base64. session/structs.go decodes fixed-packing WPILib structs — Pose2d/3d, Rotation2d/3d, Translation2d/3d, Transform2d/3d, Twist2d/3d, ChassisSpeeds, SwerveModuleState/Position, Quaternion, and their [] arrays — into named-field objects, wired into both the log path (decodeValue) and the live NT path (pump). Unknown/length-mismatched payloads fall back to raw bytes.
    Verified on a real 2026-Robot log: Pose2d → {x,y,theta}, Rotation2d → {value}, ChassisSpeeds → {vx,vy,omega}, SwerveModuleState[] → [{speed,angle},…].
  • F11 for range — range now accepts --format csv|parquet, emitting long-format {key,timestamp,value} rows straight into pandas.read_csv/read_parquet (df.pivot(...) to go wide). Documented as the preferred raw-series path.
  • F10/F13 (CSV) — float64 rendered in fixed notation, so large timestamps print 30046400 not 3.00464e+07 and integral values drop the trailing .0.
  • Python Session — adds range_df(*keys, pivot=False) (parquet → tidy DataFrame); query()/range() docstrings now steer transform work to pandas.
  • Docs — ported USABILITY_FRICTION.md from the stale Dev/TheFRCSuite clone (its only unique file) and appended a resolution log + a note on the two-clone consolidation.

Not done (intentionally, per the freeze)

F1, F2, F10 (JSON precision), F12, F14, F15, F16 — not pursued in the SPL engine; F1/F2 stop mattering once transforms move to pandas.

Tests

  • Go: go test ./... green — new struct-decode tests (session/structs_test.go) and range CSV/parquet reshape tests (cli/commands_test.go).
  • Python: 12 passed — new range_df long-format/pivot/empty tests.
  • End-to-end: struct decode + range --format parquet/csv exercised against a real wpilog.

🤖 Generated with Claude Code

…L transform

Strategic pivot: freeze the SPL *transform* stages (eval/where/timechart/rex/
stats-by) and lean on cs -> parquet -> pandas for transforms, keeping SPL's
access/correlation verbs and the dedicated verbs first-class. Rationale and
resolution status in ClaudeScope/USABILITY_FRICTION.md.

F17 (highest-value telemetry gap): WPILib struct fields no longer return an
opaque base64 blob. New session/structs.go decodes the known fixed-packing
structs (Pose2d/3d, Rotation2d/3d, Translation2d/3d, Transform2d/3d, Twist2d/3d,
ChassisSpeeds, SwerveModuleState/Position, Quaternion) and their []-arrays into
named-field objects, wired into both the log decode path (decodeValue) and the
live NT path (pump). Unknown or length-mismatched payloads fall back to raw
bytes. Verified on a real log: Pose2d -> {x,y,theta}, ChassisSpeeds ->
{vx,vy,omega}, SwerveModuleState[] -> [{speed,angle},...].

F11 for range: `range` gains --format csv|parquet, emitting long-format
{key,timestamp,value} rows straight into pandas.read_csv/read_parquet.

F10/F13 (CSV): format float64 in fixed notation so large timestamps render
30046400 not 3.00464e+07, and integral values drop the trailing .0.

Python Session: add range_df(*keys, pivot=False) as the documented parquet ->
tidy DataFrame path; query()/range() docstrings point transform work at pandas.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rylero
rylero merged commit 7373b62 into main Jul 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant