Skip to content

sbe-android: decode through a generated SbeCodec that takes limits - #175

Merged
trendvidia merged 1 commit into
mainfrom
sbe-android/codec-limits-148
Nov 3, 2026
Merged

trendvidia merged 1 commit into
mainfrom
sbe-android/codec-limits-148

Conversation

@bfrancojr

@bfrancojr bfrancojr commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

A caller of a generated lite <Message>SbeCodec can now set MaxMessageSize and MaxRepeatedCount. The lite security harness now decodes through that codec, so the gate tests what a caller actually uses.

Fixes #148

What changes

  • protoc-gen-pxf-java-meta (plugin: give a generated SbeCodec overloads that take limits protowire#541) gives the generated codec unmarshal overloads that take the two limits. gradle.properties pins that branch commit (3561bdd) for now.
  • check-decode-android calls SbeWithGroupSbeCodec.unmarshal(data, maxMessageSize, maxRepeatedCount) instead of SbeWireCodec directly.
  • New SbeCodecLimitsTest lowers each limit through the generated overload.

Classification: reversible by a revert. It adds methods to generated code, and nothing is removed. Measured.

Evidence

Run at bf8df62 (the head before a CHANGELOG-only amend to 692839c) with -PpxfJavaMeta.repo=/nonexistent, so the plugin is fetched at the pin, as in CI:

Merge order and conflicts

@bfrancojr

Copy link
Copy Markdown
Collaborator Author

CI passed on 692839c, the PR head read back from the remote: Build + Test, Conformance (Go reference), Analyze and CodeQL.

@trendvidia
trendvidia force-pushed the sbe-android/codec-limits-148 branch from 692839c to bfce30e Compare November 3, 2026 08:34
@bfrancojr

Copy link
Copy Markdown
Collaborator Author

I rebased onto main 1323944, after #170 and #171 merged. The new head is bfce30e, read back from the remote.

Run locally with -PpxfJavaMeta.repo=/nonexistent, so the plugin is fetched at the pin:

  • ./gradlew build: 684 tests, 0 failures.
  • Security gate: 211 pairs ✓.
  • Through the codec, sbe/utf8-invalid-string and sbe/utf8-split-char-string exit 1 with invalid UTF-8 in string field text.

Merge order: spec #528, then spec #541, then re-pin here, then this PR.

The plugin now gives <Message>SbeCodec unmarshal overloads that take
MaxMessageSize and MaxRepeatedCount. check-decode-android calls one, so
the corpus rows that lower a limit prove the generated entry point, not
only SbeWireCodec under it. The pin moves to the plugin branch until it
merges.
@trendvidia
trendvidia force-pushed the sbe-android/codec-limits-148 branch from bfce30e to 1d8043b Compare November 3, 2026 08:57
@bfrancojr

Copy link
Copy Markdown
Collaborator Author

I rebased onto main 35d1341, after #172 and #174 merged. The new head is 1d8043b, read back from the remote.

main pins ee27eba (spec #528 plus #532). I stacked spec #541 on that commit (now 474e8ec) and pinned this PR there. The CHANGELOG conflict kept both entries.

Run locally with -PpxfJavaMeta.repo=/nonexistent, so the plugin is fetched at the pin:

  • ./gradlew build: 719 tests, 0 failures, 0 skipped.
  • Write gate ✓, text gate ✓, security gate ✓.

Merge order: spec #528, spec #532, spec #541, then re-pin to spec main.

@trendvidia
trendvidia merged commit 331d508 into main Nov 3, 2026
4 checks passed
@trendvidia
trendvidia deleted the sbe-android/codec-limits-148 branch November 3, 2026 10:07
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.

pxf-android: the generated SBE codec takes no limits

2 participants