Skip to content

feat: Replace number with bigInt for ids#152

Draft
afonsobspinto wants to merge 1 commit intofeature/edit-modefrom
feature/NA-781
Draft

feat: Replace number with bigInt for ids#152
afonsobspinto wants to merge 1 commit intofeature/edit-modefrom
feature/NA-781

Conversation

@afonsobspinto
Copy link
Copy Markdown
Member

@afonsobspinto afonsobspinto commented May 7, 2026

Closes https://metacell.atlassian.net/browse/NA-781

Done exclusively by codex GPT-5.5:

Summary

  • Migrated spatial skeleton IDs to bigint across the public skeleton API, caches, navigation, selection, hover, command history, edit state, CATMAID integration, and UI state.
  • Added shared ID helpers in src/util/bigint.ts for parsing positive uint64 IDs, bigint-safe sorting, and decimal string formatting.
    CATMAID now keeps IDs as bigint internally, serializes request/form/JSON boundary values with .toString(), and rejects unsafe numeric IDs instead of rounding them.
  • Updated command payload validation so legacy safe numeric inputs can enter at payload boundaries, but command state stores bigint IDs.
  • Updated tests to use bigint IDs, including large IDs above Number.MAX_SAFE_INTEGER.

Rendering / Shader Changes

  • Spatial skeleton segment vertex attributes changed from DataType.UINT32 to DataType.UINT64.
  • Segment and node metadata arrays now use BigUint64Array, including nodeIds, pickNodeIds, pickSegmentIds, and pickEdgeSegmentIds.
  • Shader segment handling now uses the existing uint64 path:
    • segment attribute/varying is represented as highp uvec2
    • shader converts to uint64_t
    • color/alpha lookup uses the uint64 segment appearance path instead of truncating through highp uint
  • Chunk CPU-side pick resolution preserves 64-bit IDs by copying packed segment attribute bytes into aligned BigUint64Array.
  • Overlay geometry now deduplicates/links nodes with Map<bigint, number> and emits bigint pick metadata, so selected-node marking and parent-edge picking preserve full IDs.

@afonsobspinto afonsobspinto changed the title feat: Replace number with bigInt feat: Replace number with bigInt for ids May 7, 2026
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