Skip to content

feat!: 64-bit instance ids and filament spec accessor - #2

Open
uermel wants to merge 1 commit into
mainfrom
uermel/int64-instance-id
Open

uermel wants to merge 1 commit into
mainfrom
uermel/int64-instance-id

Conversation

@uermel

@uermel uermel commented Oct 2, 2026

Copy link
Copy Markdown
Member

Summary

64-bit instance ids. Point::instance_id is now std::int64_t. copick writes Python ints, and the reflect-cpp read into an int narrowed any id ≥ 2³¹ without an error. Filament ids are instance ids, so a tracer that numbers filaments globally reaches that range.

Breaking: the layout of Point, and with it the ABI, changes. Consumers (AreTomo3) need a rebuild; code that assigns an int keeps compiling.

Filament spec accessor. New C++11 public header copick/filament.h with FilamentSpec (polar, helical_rise_a, helical_twist_deg), filament(obj) and is_filament(obj). They read the spec copick ≥ 1.28 stores at metadata["copick"]["filament"] (copick/copick#479), with copick's semantics:

  • an absent or null spec, or a "copick" value that is not an object, is not a filament;
  • unknown keys are ignored;
  • a spec copick refuses throws ValidationError: not an object, wrong field types, helical_rise_a ≤ 0, or set on a non-particle object.

It is added to copick.h and to the C++11 header guard.

Tests

  • PicksJson.InstanceIdsAre64Bit: reads and round-trips 4294967296 and 9007199254740993.
  • Filament.*: spec read; absent, null and foreign namespaces; invalid specs throw.

cmake --preset dev with GCC 13.3: 33/33 pass, including cxx11_header_guard. Formatted with clang-format 18.1.8.

🤖 Generated with Claude Code

Point::instance_id is std::int64_t. copick writes Python ints, and the
reflect-cpp read into an int narrowed any id >= 2^31 without an error.
Filament ids are instance ids, so a tracer that numbers filaments globally
reaches that range.

BREAKING CHANGE: Point::instance_id changes from int to std::int64_t, which
changes the layout of Point and the ABI. Consumers (AreTomo3) rebuild; code
that assigns an int keeps compiling.

New C++11 public header copick/filament.h: FilamentSpec (polar,
helical_rise_a, helical_twist_deg), filament(obj) and is_filament(obj) read
the spec copick >= 1.28 stores at metadata["copick"]["filament"]. An absent
or null spec, or a "copick" value that is not an object, is not a filament;
unknown spec keys are ignored; a spec copick refuses (not an object, wrong
field types, helical_rise_a <= 0, or on a non-particle object) throws
ValidationError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@uermel
uermel marked this pull request as ready for review October 5, 2026 17:38
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