Skip to content

Feat: Custom Codecs to log messages.#1008

Merged
gbin merged 6 commits into
masterfrom
gbin/codecs
Apr 6, 2026
Merged

Feat: Custom Codecs to log messages.#1008
gbin merged 6 commits into
masterfrom
gbin/codecs

Conversation

@gbin

@gbin gbin commented Apr 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

One of the big issue of Copper with for example images is that we cannot compress them.

This PR adds a way to insert any codec for any task output.

We can now add codex to:

  1. if we have mainly sparse matrix we could remove 0 from.
  2. if we know some float array is continues we could diff encode with no loss.
  3. an image could be compressed as a png.
  4. images from the same channel could be h265 encoded with some lossy or non-lossy params.
  5. we could have some specific LZ encoding with a dictionary for some type of data

etc.
Adapted the logviz demo with a png example codec and here are the results:

Metric Bincode PNG Delta
CopperList section used bytes 1,272,600 575,133 -697,467 (-54.8%)
Whole log used bytes 1,274,111 576,825 -697,286 (-54.7%)
Image raw payload bytes from log-stats 1,109,760 1,109,760 unchanged
Avg raw image payload per frame 9,248 9,248 unchanged

Related issues

  • Closes #

Changes

Testing

  • just fmt
  • just lint
  • just test
  • optional full just std-ci (if std/runtime paths are impacted)
  • optional full just nostd-ci (if embedded/no_std paths are impacted)
  • Other (please specify):

pro-tip: just with no parameters in the root defaults to just fmt, just lint, and just test.

Checklist

  • I have updated docs or examples where needed
  • I have added or updated tests where needed
  • I have considered platform impact (Linux/macOS/Windows/embedded)
  • I have considered config/logging changes (if applicable)
  • This change is not a breaking change (or I documented it below)

Breaking changes (if any)

Additional context

@gbin gbin added enhancement New feature or request include in changelog labels Apr 5, 2026
@gbin gbin requested a review from makeecat April 5, 2026 21:29

@makeecat makeecat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

only one thread safety comment needs to be discussed.
the api surface looks good.

Comment thread core/cu29_derive/src/lib.rs
@gbin gbin merged commit fc2500f into master Apr 6, 2026
23 checks passed
@gbin gbin deleted the gbin/codecs branch April 6, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants