Skip to content

Body contact: the sorted sweep, the range filter and the list resolve: body-contact-2 - #84

Merged
lamb2k merged 3 commits into
mainfrom
claude/attacks-cost
Nov 23, 2026
Merged

lamb2k merged 3 commits into
mainfrom
claude/attacks-cost

Conversation

@lamb2k

@lamb2k lamb2k commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Body contact: the sorted sweep, the range filter and the list resolve (body-contact-2)

The field walk of body-contact-1 split into a pair list, an exact range filter and the pair calls, so a caller that computes a body's position or velocity lazily pays for them only where a pair needs them. sh2z_bc_field_resolve also tests the position box in 32 bits before it calls the pair function. No body-contact-1 result changes.

  • API (new): sh2z_bc_sweep (the pairs within a window, in the field walk's order, with the bodies they touch marked), sh2z_bc_range (pairs of two ACTIVE bodies within the reach on every axis), sh2z_bc_field_resolve_list (the pair function over a list, with the field's history). Guide section and validation record included.
  • Exact: the 32-bit box test never rejects a pair the pair function accepts; positions 2^32 apart in a coordinate pass it and the pair function rejects them with no effect (tested at the ends of the int32 range). With a window that covers every pair in reach, sweep, range and list give the field walk's outputs, history and counters bit for bit.
  • Evidence (HOST): body_contact_exact under GCC and Clang strict and ASan/UBSan: the existing checks, 20 races x 300 ticks x 30 bodies of the list path against the field walk (outputs, last, toucher, since, contacts equal every tick), the int32-range case, and two controls (a 4-unit sweep window, a half-reach range filter) that are caught. The SH-2 object (-m2 -mb -O2 -Wall -Wextra -Werror) needs no libc function.
  • Not done: an instruction-model capture and a console run. No results.json section changes.
  • Upstream style: the new functions follow the file's own form (sh2z_bc_ prefix, *_experimental.h contract-tag section, doc comments as the file writes them); not checked against a current sh4zam checkout here, for the integration owner's gate.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

lamb2k and others added 3 commits November 23, 2026 02:07
… (body-contact-2), and a 32-bit box test in the field walk

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lidation index

The record's first line must read '# Validation record — <date> (<scope>)' and
saturn/VALIDATION.md must list it; host CI's index check failed on both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lamb2k
lamb2k merged commit e83dae5 into main Nov 23, 2026
8 checks passed
@lamb2k
lamb2k deleted the claude/attacks-cost branch November 23, 2026 10:39
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