Skip to content

Strengthen runtime safety verification - #1024

Merged
Eli Pinkerton (wallstop) merged 3 commits into
mainfrom
agent/relational-binding-oracle
Oct 17, 2026
Merged

Eli Pinkerton (wallstop) merged 3 commits into
mainfrom
agent/relational-binding-oracle

Conversation

@wallstop

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

Copy link
Copy Markdown
Collaborator

DISCLOSURE: LLM-GENERATED TEXT

Why: Text scans missed unsafe calls, and binding tests missed fast-path ordering.

What:

  • Parse memory access and IL2CPP options with Roslyn.
  • Catch escaped names, invisible identifier characters, aliases, and interpolation.
  • Compare relational bindings against independent Unity queries.
  • Cover ordering and depth limits across binding shapes.

Refs #637, #644


> [!NOTE]
> Medium Risk
> Changes how CI enforces memory-safety and IL2CPP rules; mis-parsing could miss real violations or false-positive, though coverage is heavily expanded in contract tests.
>
> Overview
> Unsafe memory-access and IL2CPP option linting no longer rely on regex over stripped source. The SyntaxPolicy tool gains --unsafe-access-json and --il2cpp-code-json, backed by shared SafetySyntaxTrees parsing that expands up to twelve #if symbol combinations per file. Unsafe scanning flags reinterpretation members and refuses aliases/static Unsafe imports; IL2CPP scanning returns normalized token text plus Il2CppSetOption argument-list positions (including attribute aliases) for the existing JS value judge.
>
> lint-unsafe-code.js routes those checks through the Roslyn DLL, tightens prefiltering for Unicode escapes and format characters, deduplicates IL2CPP findings per site, and expands positive controls (escaped, interpolated, format-character fixtures). Contract tests and contributing docs describe the new behavior.
>
> Relational component binding gets a large matrix fixture (RelationalBindingMatrixTarget) and runtime tests that call AssignRelationalComponents and assert single/array/list/set fields match independent hierarchy queries across sibling/parent/child directions, filters, depth/count limits, reflection capability modes, and scene mutations.
>
> Reviewed by Cursor Bugbot for commit d30382f. 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.
@wallstop

Copy link
Copy Markdown
Collaborator Author

DISCLOSURE: LLM-GENERATED TEXT

Verified final head d30382f2507d4f3944af5c0719c4b32a7a4fa76e: all 29 checks are complete, with 23 successful checks and six expected skips. Cursor review passes and no review threads remain.

  • All 274 safety controls pass locally and in CI, including compile-only spelling proofs and raw format-character controls that fail on the previous implementation.
  • The independent binding matrix passes 720 native cases: 72 each in PlayMode and Standalone across four Unity versions and the latest SINGLE_THREADED variant. Ordering/depth mutations fail the new oracle; restored source passes.
  • Generator suites pass 906 analyzer, 1,385 protobuf-net v3 oracle, and 1,354 v2 oracle cases, with zero failures/skips. Source compilation, compiler controls, contracts, documentation, formatting and spelling checks pass.
  • The hosted safety SARIF matches the local report and validates against the official schema. All 19 native archives match GitHub digests; all six acquired native jobs confirm healthy license cleanup and lock release.

Native qualification: the two 6000.6 jobs record 18 0xC0000005 exits accepted under the existing validated-artifact policy. Their cause remains unresolved despite passing XML and healthy cleanup; full qualification. No flags/permissions or result policies changed.

Runtime source and shipped DLLs are unchanged from base e1609943. Broader acceptance remains tracked in #343, #637 and #644; none is closed by this PR.

@wallstop
Eli Pinkerton (wallstop) merged commit fb85092 into main Oct 17, 2026
29 checks passed
@wallstop
Eli Pinkerton (wallstop) deleted the agent/relational-binding-oracle branch October 17, 2026 20:54
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