Skip to content

Conversation

jakebailey
Copy link
Member

This code is subtly wrong because some of the IDs are uint64 and are being converted to uint32. In long running programs, this would manifest as very strange behavior.

I don't think we actually need anything special here; any is enough to do the right thing and avoids making that same mistake in the same amount of space as it would take to expand the struct to have a uint64 value + padding.

@Copilot Copilot AI review requested due to automatic review settings July 30, 2025 04:15
Copilot

This comment was marked as outdated.

@jakebailey jakebailey requested a review from Copilot August 12, 2025 19:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR simplifies the RecursionId type to prevent data corruption from uint64 to uint32 conversions. The change replaces a structured approach with an any-based implementation that preserves the full precision of ID values.

  • Removes the complex RecursionIdKind enum and structured RecursionId with separate kind/id fields
  • Introduces a generic asRecursionId function to constrain valid types while using any for storage
  • Updates all usage sites to use the simplified API

@jakebailey jakebailey added this pull request to the merge queue Aug 12, 2025
Merged via the queue into main with commit 29b9b8a Aug 12, 2025
22 checks passed
@jakebailey jakebailey deleted the jabaile/recursion-id-any branch August 12, 2025 20:16
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