Skip to content

Use bigint for paths to avoid PathTooLarge errors - #99

Merged
Rigidity merged 1 commit into
mainfrom
bigint-paths
Jul 25, 2026
Merged

Use bigint for paths to avoid PathTooLarge errors#99
Rigidity merged 1 commit into
mainfrom
bigint-paths

Conversation

@Rigidity

@Rigidity Rigidity commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Note

Medium Risk
Touches core lowering and CLVM path codegen for every symbol reference; behavior should match for normal depths but large-path edge cases depend on the new BigUint math and atom encoding.

Overview
CLVM environment paths are now represented with BigUint end-to-end instead of u32, so deep binding trees no longer fail with PathTooLarge.

Environment::path builds paths with left-shift/add instead of checked_mul, and PathError::PathTooLarge is removed (only SymbolNotFound remains). Lir::Path and lowering/codegen/optimizer call sites use BigUint; path atoms go through path_to_atom with the same big-endian trimming behavior, extended for large values.

Path math in path.rs (first_path, rest_path, parent_path) is rewritten for arbitrary size, with a new test that walks 100 rest/parent steps.

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

@Rigidity
Rigidity merged commit d7f3a15 into main Jul 25, 2026
2 checks passed
@Rigidity
Rigidity deleted the bigint-paths branch July 25, 2026 16:53
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