-
Notifications
You must be signed in to change notification settings - Fork 22
Add encode-tensogram action for Tensogram message format #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 3 commits
90842f7
9b7ef61
0984d96
a642df9
0bc2746
00e9bb3
c972412
3dafd9d
797bfcf
f905d01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,131 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Claude and Other Agents | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Guidelines | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - NOTE: When the user's request matches an available skill: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - ALWAYS invoke it using the Skill tool as your FIRST action. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Do NOT answer directly, do NOT use other tools first. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - The skill has specialized workflows that produce better results than ad-hoc answers. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - CRITICAL: Always prefer the LSP tool over Grep/Read for code navigation. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Use it to find definitions, references, and workspace symbols. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - IMPORTANT: when planing and before you do any work: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - ALWAYS mention how you would verify and validate that work is correct | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - include TDD tests in your plan | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - take a behaviour driven approach | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - you are very much ENCOURAGED to ask questions to get the design correct | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - ALWAYS seek clarifications to sort out ambiguities | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - ALWAYS provide a summary of the Design and implementation Plan | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - NOTE: When the user asks for "second pass", "third pass" or "N-th pass" perform: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - simplification opportunities, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - naming/comments/docs quality review, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - scan for edge-cases and logical regression, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - in C/C++ NEVER produce undefined behavior and never segfault or stop executiong without returning error or exceptions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - all documentation up-to-date with changes, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - running required formatter/lint/tests | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - NOTE: when user asks for 'error handling' checks: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - verify no panic in rust code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - verify how errors are handled across-code base, all languages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - ensure all errors handled and reported correclty with enough information reaching users | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - in C/C++ NEVER produce undefined behavior and never segfault or stop executiong without returning error or exceptions | |
| - all documentation up-to-date with changes, | |
| - running required formatter/lint/tests | |
| - NOTE: when user asks for 'error handling' checks: | |
| - verify no panic in rust code | |
| - verify how errors are handled across-code base, all languages | |
| - ensure all errors handled and reported correclty with enough information reaching users | |
| - in C/C++ NEVER produce undefined behavior and never segfault or stop executing without returning error or exceptions | |
| - all documentation up-to-date with changes, | |
| - running required formatter/lint/tests | |
| - NOTE: when user asks for 'error handling' checks: | |
| - verify no panic in rust code | |
| - verify how errors are handled across-code base, all languages | |
| - ensure all errors handled and reported correctly with enough information reaching users |
Copilot
AI
Apr 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: commited → committed.
Copilot
AI
Apr 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: REMEBER → REMEMBER.
| - REMEBER on releases: | |
| - REMEMBER on releases: |
Copilot
AI
Apr 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section states the Git project is github.com/ecmwf/tensogram and includes release/versioning rules for that project. In this repository (Multio), that appears misleading and may confuse contributors; please either remove it or update it to reflect this repo’s actual versioning/release process and canonical version file (if any).
| - Git project in github.com/ecmwf/tensogram | |
| - IMPORTANT: | |
| - versions are tagged using Semantic Versioning form 'MAJOR.MINOR.MICRO' | |
| - NEVER update MAJOR unless users says so. | |
| - Increment MINOR for new features. MICRO for bugfixes and documentation updates. | |
| - NEVER prepend git tag or releases with 'v' | |
| - REMEBER on releases: | |
| - check all is commited and pushed upstream, otherwise STOP and warn user | |
| - update the VERSION file | |
| - git tag with version | |
| - push and create release in github | |
| - NOTE: SINGLE SOURCE OF TRUTH FOR VERSION — The `VERSION` file at the repo root is the | |
| canonical version for the ENTIRE project. ALL version strings everywhere MUST match it. | |
| When bumping the version (e.g. during a release), you MUST update ALL of these locations | |
| to match the VERSION file: | |
| - `VERSION` (the source of truth) | |
| - `pyproject.toml` | |
| - `CHANGELOG.md` (new release entry header) | |
| - Use the versioning and release process defined by this repository only. | |
| - Do not reference or follow release rules copied from other projects. | |
| - Before changing any version, tag, or release metadata: | |
| - inspect the files and automation present in this repo to determine the canonical source(s) of version information | |
| - confirm the expected version format and release steps from this repo's existing documentation and tooling | |
| - if the canonical version file or release workflow is unclear, stop and ask for clarification rather than guessing | |
| - When preparing a release: | |
| - ensure all intended changes are committed and pushed as required by the project's workflow | |
| - update only the version-related files that this repository actually uses | |
| - create tags/releases only according to this repository's documented conventions |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| # (C) Copyright 2025- ECMWF. | ||
| # | ||
| # This software is licensed under the terms of the Apache Licence Version 2.0 | ||
| # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
| # In applying this licence, ECMWF does not waive the privileges and immunities | ||
| # granted to it by virtue of its status as an intergovernmental organisation | ||
| # nor does it submit to any jurisdiction. | ||
|
|
||
| # Try to find the Tensogram library (N-dimensional tensor message format) | ||
| # | ||
| # Tensogram is a Rust-core library with a C FFI layer and a C++ header-only wrapper. | ||
| # This module locates the pre-built static library and the required headers. | ||
| # | ||
| # The following paths will be searched, both in the environment and as CMake variables: | ||
| # | ||
| # TENSOGRAM_ROOT | ||
| # TENSOGRAM_DIR | ||
| # TENSOGRAM_PATH | ||
| # | ||
| # If found, the tensogram::tensogram imported target will be created. | ||
| # | ||
| # Output variables: | ||
| # tensogram_FOUND - True if tensogram was found | ||
| # TENSOGRAM_INCLUDE_DIRS - Include directories (C++ wrapper + C FFI header) | ||
| # TENSOGRAM_LIBRARIES - Libraries to link against | ||
|
|
||
| # --- Locate the C++ header-only wrapper: tensogram.hpp --- | ||
|
|
||
| find_path(TENSOGRAM_CPP_INCLUDE_DIR | ||
| NAMES tensogram.hpp | ||
| HINTS | ||
| ${TENSOGRAM_ROOT} | ||
| ${TENSOGRAM_DIR} | ||
| ${TENSOGRAM_PATH} | ||
| ENV TENSOGRAM_ROOT | ||
| ENV TENSOGRAM_DIR | ||
| ENV TENSOGRAM_PATH | ||
| PATH_SUFFIXES include | ||
| ) | ||
|
|
||
| # --- Locate the C FFI header: tensogram.h --- | ||
| # This is typically in a different include path (crates/tensogram-ffi/) | ||
|
|
||
| find_path(TENSOGRAM_FFI_INCLUDE_DIR | ||
| NAMES tensogram.h | ||
| HINTS | ||
| ${TENSOGRAM_ROOT} | ||
| ${TENSOGRAM_DIR} | ||
| ${TENSOGRAM_PATH} | ||
| ENV TENSOGRAM_ROOT | ||
| ENV TENSOGRAM_DIR | ||
| ENV TENSOGRAM_PATH | ||
| PATH_SUFFIXES include crates/tensogram-ffi | ||
| ) | ||
|
|
||
| # --- Locate the Rust static library: libtensogram_ffi.a --- | ||
|
|
||
| find_library(TENSOGRAM_LIBRARY | ||
| NAMES tensogram_ffi | ||
| HINTS | ||
| ${TENSOGRAM_ROOT} | ||
| ${TENSOGRAM_DIR} | ||
| ${TENSOGRAM_PATH} | ||
| ENV TENSOGRAM_ROOT | ||
| ENV TENSOGRAM_DIR | ||
| ENV TENSOGRAM_PATH | ||
| PATH_SUFFIXES lib lib64 target/release | ||
| ) | ||
|
|
||
| # --- Aggregate results --- | ||
|
|
||
| set(TENSOGRAM_INCLUDE_DIRS ${TENSOGRAM_CPP_INCLUDE_DIR} ${TENSOGRAM_FFI_INCLUDE_DIR}) | ||
| set(TENSOGRAM_LIBRARIES ${TENSOGRAM_LIBRARY}) | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
| find_package_handle_standard_args(tensogram | ||
| DEFAULT_MSG | ||
| TENSOGRAM_LIBRARY | ||
| TENSOGRAM_CPP_INCLUDE_DIR | ||
| TENSOGRAM_FFI_INCLUDE_DIR | ||
| ) | ||
|
|
||
| mark_as_advanced(TENSOGRAM_CPP_INCLUDE_DIR TENSOGRAM_FFI_INCLUDE_DIR TENSOGRAM_LIBRARY) | ||
|
|
||
| # --- Create imported target --- | ||
|
|
||
| if(tensogram_FOUND AND NOT TARGET tensogram::tensogram) | ||
|
|
||
| # The Rust static library (imported) | ||
| add_library(tensogram_ffi STATIC IMPORTED GLOBAL) | ||
| set_target_properties(tensogram_ffi PROPERTIES | ||
| IMPORTED_LOCATION "${TENSOGRAM_LIBRARY}" | ||
| ) | ||
|
|
||
| # Header-only C++ wrapper (INTERFACE) linking the Rust lib + platform libs | ||
| add_library(tensogram::tensogram INTERFACE IMPORTED GLOBAL) | ||
| set_target_properties(tensogram::tensogram PROPERTIES | ||
| INTERFACE_INCLUDE_DIRECTORIES "${TENSOGRAM_CPP_INCLUDE_DIR};${TENSOGRAM_FFI_INCLUDE_DIR}" | ||
| ) | ||
| target_link_libraries(tensogram::tensogram INTERFACE tensogram_ffi) | ||
|
|
||
| # Platform-specific system libraries required by the Rust static library | ||
| if(APPLE) | ||
| target_link_libraries(tensogram::tensogram INTERFACE | ||
| "-framework CoreFoundation" | ||
| "-framework Security" | ||
| "-framework SystemConfiguration" | ||
| "-lc++" | ||
| "-lm" | ||
| ) | ||
| elseif(UNIX) | ||
| target_link_libraries(tensogram::tensogram INTERFACE | ||
| dl | ||
| pthread | ||
| m | ||
| stdc++ | ||
| ) | ||
| endif() | ||
|
|
||
| endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in this guideline header:
planing→planning.