Skip to content

feat: local field on main, greybox host, weaving stamps - #330

Merged
lazyxeon merged 4 commits into
mainfrom
cursor/localsim-on-main-01c3
Oct 16, 2026
Merged

lazyxeon merged 4 commits into
mainfrom
cursor/localsim-on-main-01c3

Conversation

@lazyxeon

@lazyxeon lazyxeon commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Description

Rebased onto main 84d3888a (#329). Draft. Do not merge.

Greybox::step keeps the bridge agent and the dig, then ticks LocalSim. The greybox golden is b6a9d5a2c5da28a6 (the #329 golden plus field_digest).

local_sim is the 16th required replay case. The digest that matched on three OSes before this rebase was 77768119e8ef4377a23268b522bf3d2303b44cf4ca0cda39eb15c7fef5eb29c8. This rebase does not change that case's bytes.

LocalSim::gravity_mm_s2_at samples a cell through astraweave_weaving::gravity_mm_s2. gravity.rs is deleted. PhysicsWorld::step still reads the Rapier gravity vector only, so the other required replay cases stay on that path.

#253 is already closed as superseded by this PR.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Security enhancement

Security Considerations

  • Does this PR introduce new dependencies? If yes, have they been vetted for security issues?
    • No new crates.io crates.
  • Does this PR modify how user input is handled? If yes, has it been validated/sanitized?
  • Does this PR change authentication or authorization mechanisms?
  • Does this PR access sensitive data or modify how it's stored?
  • Does this PR introduce new network communication or modify existing protocols?

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings
  • I have run security checks (cargo audit, cargo deny) locally

Milestone

Rebased onto #329. Greybox golden recomputed. local_sim is required. CI is running on this push. Do not merge.

Open in Web Open in Cursor 

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: d74a119c-980c-4d20-97a5-58a62a1ef685
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

cursoragent and others added 4 commits October 16, 2026 16:18
FieldWrite and FieldEvent are weaving's records. LocalSim implements
SimField. Material ids match the weaving stamp list, wood ignites at
300, and the freeze hold is -200. A destruction brush opens a cell
that volume falls through. The greybox publishes columns into the
traversal water probe. submersion_between feeds the swim state.

local_sim is written into the replay artifact and is not required
until the three OS hashes match.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
The test ran with the crate as its working directory, so a relative
target path missed the workspace file the merge step reads.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
Linux, Windows, and macOS agreed on
77768119e8ef4377a23268b522bf3d2303b44cf4ca0cda39eb15c7fef5eb29c8.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
The field now sits on main after the bridge dig. The golden is
b6a9d5a2c5da28a6. Cell acceleration is gravity_mm_s2 of the zone's
milli-g. gravity.rs is gone; PhysicsWorld::step still uses Rapier.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/localsim-on-main-01c3 branch from 52635e6 to 38279cb Compare October 16, 2026 16:25
@lazyxeon
lazyxeon marked this pull request as ready for review October 16, 2026 18:37
@lazyxeon
lazyxeon merged commit 10757c8 into main Oct 16, 2026
31 checks passed
@lazyxeon
lazyxeon deleted the cursor/localsim-on-main-01c3 branch October 16, 2026 18:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T18:42:59.468667Z 38279cb Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38279cb84a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1248 to +1249
let mat = material_of(materials, material);
let base = i32::from(mat.map(|m| m.density0).unwrap_or(1000));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Derive published density from the liquid phase

When ordinary liquid is stamped into a nonsolid cell, sample_solid labels that cell MAT_AIR, whose demo_materials row has density0: 0; neither AddVolume nor SetPhase changes the material. This therefore publishes a density of zero for normal water, and PhysicsWorld::apply_buoyancy_forces multiplies that value directly into the buoyancy force, causing bodies to sink through locally simulated water. The base density should come from the liquid phase, such as water or oil, rather than the underlying solid-field material.

Useful? React with 👍 / 👎.

Comment on lines +1244 to +1246
if self.column_len as usize >= MAX_COLUMNS {
self.column_drops = self.column_drops.saturating_add(1);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Deduplicate water columns before enforcing the cap

When more than one region contains dense liquid, the first region can consume all 4,096 entries with one row per wet voxel before this cap is checked for later regions; the subsequent deduplication may shrink those entries to only 256 XZ columns, but every later region has already been dropped. As a result, physics receives no water columns for those later regions even though the final deduplicated table had ample capacity. Deduplicate by (x, z) while collecting, or enforce the cap only on unique columns.

Useful? React with 👍 / 👎.

if index == 0 {
return Some((0, -1, 0));
}
let zone = zones.iter().find(|z| z.index == index)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fall back to world gravity when a zone row is absent

If a persisted cell references a gravity index that is omitted from a later tick's zones slice, this ? returns None, which the flow solver interprets as no gravity and therefore traps liquid in place. For the same cell, gravity_milli_g_at explicitly falls back to world gravity when the row is missing, so fluid and entity gravity disagree after a zone is removed or temporarily unavailable. Missing rows should take the same world-down fallback used by the public gravity sampler.

Useful? React with 👍 / 👎.

lazyxeon added a commit that referenced this pull request Oct 16, 2026
#330 is on main. The greybox golden is b6a9d5a2c5da28a6.
gravity.rs is deleted and #336 is closed. #253 leaves the
in-progress list.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Oct 17, 2026
#330 added benches/tick.rs. The runner treats an unmapped discovered
package as fatal, so every shard exited before Criterion ran and the
regression alert failed the same way. The 600s cap and the 14-way
matrix stay as they are.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
lazyxeon added a commit that referenced this pull request Oct 17, 2026
#330 added benches/tick.rs. The runner treats an unmapped discovered
package as fatal, so every shard exited before Criterion ran and the
regression alert failed the same way. The 600s cap and the 14-way
matrix stay as they are.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
@cursor cursor Bot mentioned this pull request Oct 21, 2026
11 of 20 tasks
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.

2 participants