Skip to content

refactor(sdk): simplify the 0.36.0 surfaces (stacked on #202) - #203

Open
facontidavide wants to merge 5 commits into
feat/derived-objects-sdk-integrationfrom
refactor/sdk-0.36-simplify
Open

facontidavide wants to merge 5 commits into
feat/derived-objects-sdk-integrationfrom
refactor/sdk-0.36-simplify

Conversation

@facontidavide

Copy link
Copy Markdown
Contributor

Stacked on #202: it targets feat/derived-objects-sdk-integration, not main. These are the cleanups from a simplify pass (reuse, simplification, efficiency and altitude) over the 0.36.0 diff. No C ABI, vtable, flag, enum or wire-format change. The decisions that would change the contract are listed in a comment on #202, not made here.

Changes

  • Codec / C++ wrappers
    • image_annotations_codec.cpp writes colours with builtin_wire::writeColor / normalizedToByte instead of byte-identical local copies. The local decoder stays: annotation colours default alpha to 1 and skip unknown fields.
    • create() and createV2() share detail::collectResolvedTopics.
    • Removed the no-op reserved = 0 after {}.
  • Field tables
    • detail::assignPayloadBytes<T> replaces four identical buffer_assign lambdas.
    • All 32 FieldTable<T>::fields arrays deduce their size. With a hand-counted N, too few initialisers silently left descriptors with null accessors.
    • Image and DepthImage layouts use PointField::Datatype and bytesPerElement instead of the magic tags 2, 4 and 7.
  • PinholeIntrinsics::fromK() validates K once; unprojectPixel stays as the one-pixel form. PJ4's depth_ops currently re-validates K for every pixel at playback rate.
  • Fix: ObjectTopicMetadataBuilder::snapshot(false) now clears the key. It was a no-op, although its comment said otherwise.
  • Tests
    • Shared expectSameWireBytes (it was copied 9 times) and a manifestWith(key, value) manifest helper.
    • The unprojectPixel test moved inside the namespace and now covers PinholeIntrinsics.
  • Docs
    • The CHANGELOG 0.36.0 section now states the net change against 0.35.0 (−166 lines). Entries narrating the unreleased line's own history are removed: the rename, "grows from 32 to 48 bytes", "the previous text would have…". The Host contract: line is untouched, and check_feature_floors.py is OK.
    • The "64 handles / 64 MiB" numbers are removed; they contradicted "host policy".
    • LIFETIME no longer says "exactly one of three" and then lists four.
    • The capability rule is copied in fewer places.
    • Fixed: a stale skill note about the annotation codec, a non-existent buffer<>(), and the hand-kept list of tabled types.
    • New rows in sdk-utilities.md.

Test plan

Consumers are source-compatible. The one removed symbol, detail::depthImageBytesPerPixel (now detail::depthImageDatatype), is used nowhere in PJ4 or the plugins.

🤖 Generated with Claude Code

facontidavide and others added 5 commits October 10, 2026 17:52
… helper

The ImageAnnotations codec writes colours through builtin_wire::writeColor
and normalizedToByte instead of byte-identical local copies; the local
decoder stays, because annotation colours default alpha to 1 and skip
unknown fields. create() and createV2() share detail::collectResolvedTopics
for the count-then-fill retry. Drop the no-op reserved = 0 after value
initialisation, and note that snapshot v2 is a full deep copy to acquire
when the catalog may have changed, not per tick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…med pixel datatypes

- detail::assignPayloadBytes<T> replaces four identical buffer_assign lambdas
  (PointCloud, Image, DepthImage, VideoFrame).
- Every FieldTable<T>::fields array deduces its size: a hand-counted N with too
  few initialisers left trailing descriptors with null accessors.
- Image and DepthImage pixel layouts name PointField::Datatype and derive the
  byte size from bytesPerElement instead of the magic tags 2, 4 and 7.
- PinholeIntrinsics::fromK validates K once, so a per-pixel loop checks only
  its own inputs; unprojectPixel stays as the one-pixel form.
- field_table.hpp says list elements are addressable one by one, so a binder
  reads list_at lazily instead of materialising the list per access.
- The unprojectPixel test moves inside the PJ namespace with its include at the
  top, and covers PinholeIntrinsics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
snapshot(false) after snapshot() left pj_snapshot set although the comment
promised the incremental default. It now removes the key. The key's comment
also called it a "field table" stream, a name taken by FieldTable<T> in the
same release; it is a snapshot stream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
field_table_test compares serialized bytes through expectSameWireBytes
instead of nine copies of the same five lines. plugin_catalog_test builds its
manifests with manifestWith(key, value) on one minimal manifest constant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…act text

- CHANGELOG 0.36.0 lists what changed since 0.35.0. Entries narrating the
  unreleased line's own history (a rename, a struct that "grew", text the
  previous draft "would have" broken) are gone, and so is the contradiction
  between the 64-handle / 64 MiB numbers and "host policy". The Host contract
  line is unchanged.
- The toolbox guide no longer states those limits as numbers, and says
  createV2 serves every kind.
- LIFETIME no longer says "exactly one of three" before listing four: a
  pinned node can also be history-exempt.
- The capability rule keeps one statement (plugin_data_api.h) and the guide's
  table; ARCHITECTURE.md and the plugin skill point to them.
- Fix the stale skill note that the annotations codec drops image_topic and
  the timestamp, the reference to a buffer<>() factory that does not exist,
  and the hand-kept list of tabled types (describe() is the list).
- Note that a zero ImageAnnotations timestamp reads as absent, that an empty
  scene_view kind clears the view, and add the new helpers to sdk-utilities.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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