Skip to content

feat(metrics): the size of each trial, in Trial, Progress::Trial and everywhere a trial is reported - #59

Merged
vlad-salone merged 1 commit into
mainfrom
feat/trial-size
Oct 13, 2026
Merged

vlad-salone merged 1 commit into
mainfrom
feat/trial-size

Conversation

@vlad-salone

Copy link
Copy Markdown
Collaborator

Closes #55, with a plain size on the Rust Trial: the search is the one place that holds the bytes of a trial that did not win, so the number is made where it is known and carried out from there.

sqzer-metrics   Trial { quality, score, size }, filled by Search::encode_with from the bytes it scores
sqzer           Progress::Trial { n, max, quality, score, size }
sqzer-cli       each entry of trials in --json, -v after the score, the progress line per trial
sqzer-wasm      Trial in Output.trials, and TrialProgress, which onTrial receives
// the page, for each trial as it lands
image.encode({ onTrial: ({ n, max, quality, score, size }) => draw(quality, score, size) });

Search::run is generic over the output, so it cannot measure the output itself. Its closure now returns Scored { output, score, size } in place of (output, score); the tests over pure curves hand it a size that follows the quality and check it comes back on every trial. That and the new fields are the breaking entries in the changelog, under metrics and sqzer. Every other check is against the file written: in the facade, the CLI and the package tests, the trial at the chosen quality has the size of the output bytes.

Checked locally: cargo test -p sqzer-metrics -p sqzer -p sqzer-cli, cargo clippy --workspace --all-targets --all-features, cargo doc with warnings denied, cargo deny check, and wasm-pack test --node, 16 tests.

The page bumps its version after the release, as the issue says; nothing in ROADMAP.md lists it, so there is no line to remove there.

🤖 Generated with Claude Code

…everywhere a trial is reported

The search holds the encoded bytes of every trial when it scores them,
and reported only quality and score, so a page drawing the search could
plot nothing against size. `Trial` gains `size`, filled by the search;
`Search::run` takes a closure returning `Scored`, with the output, the
score and the size, in place of the pair. `Progress::Trial` carries it,
each entry of `trials` in `--json` carries it, `-v` and the progress
line print it, and the npm package has it on `Trial` and on what
`onTrial` receives.

Closes #55

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High impact] This PR appears safe to merge; no actionable issues were found.

Summary

Adds size to each trial report and live progress event, from the search through the Rust facade, CLI, and JavaScript package.

  • Search trials now carry the size of their encoded output.
  • CLI trial reports now show each encoded size.
  • Wasm trial results and callbacks now include encoded sizes.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A["Encoder produces bytes"] --> B["Search measures bytes.len()"]
  B --> C["Trial and Scored"]
  C --> D["SearchReport.trials"]
  C --> E["Progress::Trial"]
  D --> F["CLI JSON and verbose output"]
  D --> G["JavaScript Output.trials"]
  E --> H["CLI progress line"]
  E --> I["JavaScript onTrial"]
Loading

Reviews (1) · Last reviewed commit: "feat(metrics): the size of each trial, i..." · Reviewed by Greptile

@vlad-salone
vlad-salone merged commit 3abaa5a into main Oct 13, 2026
23 checks passed
@vlad-salone
vlad-salone deleted the feat/trial-size branch October 13, 2026 13:05
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.

The size of each trial, in Trial and TrialProgress

1 participant