Skip to content

feat(cli): decode firmware_version as the device release version - #204

Open
calvinleng-science wants to merge 1 commit into
mainfrom
calvin/change-firmware-version
Open

calvinleng-science wants to merge 1 commit into
mainfrom
calvin/change-firmware-version

Conversation

@calvinleng-science

@calvinleng-science calvinleng-science commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

synapsectl info decodes firmware_version into the device release version (e.g. Firmware Version: 2.5.0), using a new decode_firmware_version() next to decode_synapse_version().

DeviceInfo.firmware_version (uint32) now carries the device release version from headstage's ops/release/manifest.toml, packed as 0xDDMMmmpp:

bits meaning
31-24 device: 1 = SciFi1, 2 = SciFi2
23-16 major
15-8 minor
7-0 patch

e.g. SciFi2 2.5.0 → 0x02020500, SciFi1 1.10.0 → 0x01010A00.

Backwards compatible: older firmware put its git hash in this field. Anything without a device byte of 1 or 2 is shown as that hash in hex, as before. I checked the release merge commits on headstage main (where release builds are made, as 8-char hashes): none starts with 01/02, so no released firmware gets misread. Only about 1 in 128 ad-hoc dev builds could.

Testing

  • synapse/tests/utils/test_version.py covers 2.5.0, 1.10.0 and the git-hash fallback.
  • Decoded a real SciFi2 running the new firmware: 0x2020500 → 2.5.0.

Related PRs

SciFi firmware now packs its release version into DeviceInfo.firmware_version (device byte 1/2, then major/minor/patch). synapsectl info shows it as e.g. 2.5.0; older firmware that sent a git hash still shows that hash in hex.
Copilot AI balanced review requested due to automatic review settings November 20, 2026 03:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The hex fallback drops leading zeroes from legacy eight-character commit hashes, producing incorrect prefixes that cannot reliably identify firmware in Git.

1 open issue
What changed in this PR

Updates synapsectl info to display packed firmware versions as readable device release versions, such as 2.5.0.

Changes:

  • Adds a firmware-version decoder for SciFi1 and SciFi2, with a hexadecimal fallback for legacy values.
  • Uses the decoder in the CLI while preserving Unknown for missing values.
  • Adds unit tests for both device encodings and the legacy fallback.
File Description
synapse/​utils/​version.py Adds firmware release decoding and legacy hexadecimal fallback.
synapse/​tests/​utils/​test_version.py Tests packed releases and a legacy hash.
synapse/​cli/​device_info_display.py Displays the decoded firmware version in device summaries.

Review effort: Balanced

Comment thread synapse/utils/version.py
"""
# ponytail: an old git hash whose top byte happens to be 0x01/0x02 decodes wrongly; unavoidable without a proto change.
if (v >> 24) & 0xFF not in (1, 2):
return f"{v:x}"

This branch has not been deployed

No deployments
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.

2 participants