Skip to content

Improve protobuf reads, snapshots, and build logs - #1025

Merged
Eli Pinkerton (wallstop) merged 8 commits into
mainfrom
agent/standalone-exit-evidence
Oct 18, 2026
Merged

Eli Pinkerton (wallstop) merged 8 commits into
mainfrom
agent/standalone-exit-evidence

Conversation

@wallstop

@wallstop Eli Pinkerton (wallstop) commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

DISCLOSURE: LLM-GENERATED TEXT

Why: Common protobuf reads and authored rule copies do extra work, while Standalone builds omit Editor exit evidence.

What:

  • Decode short varints directly and continue longer reads from the checked prefix.
  • Preserve malformed-input, overflow, truncation, and packed-budget checks.
  • Copy authored rules through typed snapshots with legacy text behavior and builder isolation.
  • Capture Standalone Editor process and watchdog receipts without changing artifact acceptance.

Refs #343, #870, #821; unresolved native and allocator evidence remains on #343 and #393.


Note

Medium Risk
Touches runtime protobuf decoding and CI Standalone build invocation; behavior is heavily tested but both are sensitive paths.

Overview
Speeds up WallstopProto varint and tag reads with inlined fast paths for 1–3 byte encodings and a shared long-varint helper, plus a cheaper packed-element count scan. Malformed-input latching, strict 32-bit limits, read budgets, and packed-element charging stay the same; new reader-limit tests cover widths, truncation, and packed charging.

Editor validation snapshots authored rules via ValidationWorkspaceSettings.Clone instead of JsonUtility round-trips, normalizing only what legacy JSON did (null strings → empty) so active runs stay detached from later builder edits.

CI factors Editor watchdog + *.execution-diagnostics.json into Invoke-UnityObservedEditor; Standalone IL2CPP player builds use it with wall-clock timeout only (no stall guard), while existing player-artifact acceptance and benign-exit warnings are unchanged.

Reviewed by Cursor Bugbot for commit 2c9784a. Bugbot is set up for automated code reviews on this repo. Configure here.

Relational binding needs an independent contract across hierarchy and cache states.
Compare 144 fields with direct Unity queries across three relations, all four
shapes, sealed/base/interface matching, state and filters, and depth/count limits.
Exercise 72 combinations and eight cache/hierarchy checkpoints.

Unity 6000.4.6f1 PlayMode passes 226 cases with zero failures or skips. Removing
breadth-first ordering causes 48 failures. Removing the parent depth limits causes
72 failures. Restored Runtime sources match the base revision. The first ordering
mutation exposed missing fast-path coverage; sealed query fields close that gap.

Default, legacy, Odin and SINGLE_THREADED test-source checks and assembly-reference
probes pass. Broader lifecycle, backend and paired-performance acceptance remains
open in #644.

Refs #644
Text scans missed valid escaped identifiers and calls inside interpolation.
Use Roslyn syntax across conditional branches. Resolve attribute aliases from
syntax, preserve source positions, and require literal boolean true for values.
Keep literal text separate from interpolation code. Compile a control with unsafe
compilation disabled; never execute its memory-access calls.

All 267 safety controls pass. The normalized SARIF report has zero findings across
2,467 sources, 45 assembly definitions and 18 check projects. It records 64 bounded
stack allocations and passing memory-access, stack-bound and IL2CPP controls.
The report validates against the official OASIS SARIF 2.1.0 schema.

No Runtime source or shipped analyzer DLL changes. Broader backend conformance,
native fault causation, build-policy coverage and paired-performance acceptance
remain open in #637.

Refs #637
C# ignores format characters inside identifiers. The source prefilters
missed those spellings even though Roslyn correctly normalized them.
Send raw format characters through both safety policies and require
independent positive controls that ordinary spellings cannot mask.

Verify three characters, literal exclusions and a compile-only C# proof.
All 274 safety controls and the package scan pass. Refs #637.
Route Standalone builds through the existing observed Editor path so accepted player output retains process and native evidence. Preserve the complete watchdog result and existing build timeout policy.

Verified 113 Linux and 116 Windows observation controls, seven related runner suites, scoped lint, strict docs, and agent preflight. Refs #343.
Read common one- and two-byte varints without the full decoding loop,
keep the checked long path and cumulative packed budget, and count packed
terminators without a per-byte branch. Cover all two-byte prefixes and
packed charging at every width from one through ten bytes.

Reuse the workspace's typed rule copy instead of JsonUtility snapshot
round trips. Preserve legacy null-to-empty text and isolate builder edits.

Native Unity 6000.4.6: 63 reader-limit, 89 wire-format, 55 rule, and 28
workspace API cases pass. Release oracle suites pass 1390 v3 / 1359 v2
cases before six additional width cases, which pass in the native suite.
Editor and runtime-test compiler variants, both preflight modes, spelling,
Markdown, and strict MkDocs pass.

Same-editor array probes suggest modest short-varint gains, approximately
8-20 percent by median across the retained samples. They do not establish
a twofold facade or player improvement. Keep broader performance and
migration acceptance open on #343, #870 and #821.
@wallstop Eli Pinkerton (wallstop) changed the title Capture Standalone Editor build exit evidence Improve protobuf reads, rule snapshots, and native build evidence Oct 18, 2026
DISCLOSURE: LLM-GENERATED TEXT

Decode three-byte values directly and carry the checked low bits into the
long decoder instead of reading the prefix again. Preserve overflow,
truncation, strict structural values, failure latching, and packed budgets.

Boundary and every-truncated-prefix controls pass for the fast/slow
transitions and full-width values. Release suites pass 1405 v3 / 1374 v2
cases. Native Unity passes 72 reader-limit and 89 wire-format cases.
The complete compiler aggregate, both changed-file preflight modes, and
strict documentation checks pass.

Paired Editor probes show a useful but scoped improvement; they do not
establish the broad twofold read target or IL2CPP player performance.
Refs #343.
Comment thread Runtime/Core/Serialization/WallstopProto/WProtoReader.cs Outdated
DISCLOSURE: LLM-GENERATED TEXT

Read the span length once in TryReadVarint64 and pass that same bound to
the long decoder. Keep the masks, unsigned prefix, overflow rejection,
truncation handling and packed-budget checks unchanged.

Release v3/v2 oracle suites pass 1405/1374 cases. Native Unity passes
72 limit and 89 wire cases. Runtime compilation and both preflight modes
pass. Scoped timing samples vary; no throughput gain is claimed for the
length cache alone.

Address PR #1025 review comment 4305168207. Refs #343.
@wallstop Eli Pinkerton (wallstop) changed the title Improve protobuf reads, rule snapshots, and native build evidence Improve protobuf reads, snapshots, and build logs Oct 18, 2026
@wallstop
Eli Pinkerton (wallstop) merged commit 5b02528 into main Oct 18, 2026
38 of 41 checks passed
@wallstop
Eli Pinkerton (wallstop) deleted the agent/standalone-exit-evidence branch October 18, 2026 02:18
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