Skip to content

Recompute output integrals during stored-report verification - #4

Merged
nazeeh111 merged 2 commits into
mainfrom
fix/stored-integrals
Oct 14, 2026
Merged

nazeeh111 merged 2 commits into
mainfrom
fix/stored-integrals

Conversation

@nazeeh111

Copy link
Copy Markdown
Owner

Address the GitHub Codex review: validate retained output mesh scalars against exact-coordinate signed-integral recomputation, use recomputed values in failure tests, and bind mirrored signature fields to checked inputs/outputs. Native accumulation comparison uses1e-9 relative tolerance with no absolute floor. Before the fix, baseline/witness/undo geometry/scalar corruptions all passed; now all reject while the authentic native report verifies60 steps. Independent review also checked six mirror corruptions and schema1 compatibility.26 Python tests include the recorded native compatibility case, scalar corruption, tiny-scale tolerance and malformed values. Native analysis is unchanged; version0.1.2 corrects the verifier without claiming report authenticity or ideal-union proof.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 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-14T04:47:25.754026Z ecd4baf PR opened
ℹ️ 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.

@nazeeh111
nazeeh111 merged commit 29d11b7 into main Oct 14, 2026
2 checks passed

@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: ecd4baf9d0

ℹ️ 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 thread solidrift/verify.py
require(normalize([s.geometry() for s in states])==normalize(d['operands']),'final reduced geometry/ancestry replay mismatch')
reduced=d['operands']
final=failure_signature([check(m['vertices'],m['faces']) for m in reduced],d['final_outputs']['FLOAT'])
validate_mesh(d['final_outputs']['MANIFOLD']);output_integral(d['final_outputs']['MANIFOLD'])

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 Avoid enforcing unguaranteed final comparator validity

When reduction reaches geometry for which MANIFOLD returns invalid topology, reduce_pair() still emits a valid witness report because solidrift/engine.py validates the comparator only at baseline and during repair quality checks, not for final_outputs['MANIFOLD']. This new validate_mesh call therefore makes verify reject reports produced by the analyzer itself; recompute the retained integral without imposing a topology invariant that generation does not guarantee.

Useful? React with 👍 / 👎.

Comment thread solidrift/verify.py
Comment on lines +49 to +50
vv=[tuple(Fraction(x) for x in p) for p in vertices];origin=vv[0]
value=sum((dot(sub(vv[f[0]],origin),cross(sub(vv[f[1]],origin),sub(vv[f[2]],origin)))/6 for f in faces),Fraction(0))

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 Match Blender's origin for non-closed output integrals

When FLOAT returns an open or otherwise non-closed surface—which this helper explicitly permits—the signed face sum depends on the tetrahedron origin. native.mesh_data() stores BMesh.calc_volume(signed=True), whose triangle-volume primitive uses the world origin (Blender source), but this implementation translates every face by vertex 0. An authentic output containing a boundary triangle away from that vertex therefore gets a different recomputed scalar and is rejected; use the same world-origin integral as the native serializer.

Useful? React with 👍 / 👎.

Comment thread solidrift/verify.py
Comment on lines +55 to +57
# Blender accumulates a floating integral. Permit a narrowly declared
# relative accumulation difference, with no absolute floor at small scales.
require(math.isclose(actual,declared,rel_tol=1e-9,abs_tol=0.0),'serialized output volume differs from recomputed surface integral')

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 Allow native roundoff for translated closed meshes

For valid geometry translated far from the origin, Blender's world-origin double accumulation can differ from the exact rational result by more than this fixed 1e-9 relative tolerance because large tetrahedron terms cancel; Blender performs that accumulation as shown in its BMesh implementation. For example, a valid binary32 tetrahedron near coordinate 960,000 produces native volume 13332660.249348959 but exact volume 13332660.271769205 (a 1.68e-9 relative difference), causing an authentic report to fail here; the identical tolerance in bind_signature also needs an error bound that accounts for coordinate magnitude and accumulation.

Useful? React with 👍 / 👎.

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