Skip to content

fix(id): reject non-canonical -0.0 tuple FLOAT64 keys (#2421) - #5026

Merged
dezren39 merged 1 commit into
mainfrom
queue/7924-2421-negzero-tuple
Nov 10, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/7924-2421-negzero-tuple

Conversation

@dezren39

@dezren39 dezren39 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Implements the acceptance in #2421: the FLOAT64 decoder now rejects the stored form of -0.0.

Duplicate-PR note (§8): this supersedes PR #3436, which fixed the same bug at the pre-workspace-move path pkgs/id/src/tuple.rs. The two add the same guard: compared both diffs line-by-line — the rejection, the zero-canonicalization assertion, and the boundary roundtrips are all present here; nothing unique remains diffable on #3436 after the path move (its version no longer applies to the current tree). The salvage note is posted there.

Local verification this run: cargo test -p id-core tuple --lib — 55 passed, 0 failed (includes the 2 new tests plus the full existing tuple suite, so no other decoder branch changed behavior).

Closes #2421 on merge.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 3, 2026 16:37
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7e38aedb-aaea-4210-9f48-3487bd0ed972
Commits

Reviewing files that changed from the base of the PR and between 3d0614c and cbdb737.

Files selected for processing: 1

  • pkgs/id/crates/id-core/src/tuple.rs
  • 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

@chatgpt-codex-connector

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 ⚠️ Failed 2026-11-03T16:37:59.968806Z
We couldn’t complete this review. Comment @codex review to try again.
0c6d8e9 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

The FLOAT64 decoder reversed the sort transform and rejected NaN but
admitted the stored form of -0.0, which the encoder can never emit: push_f64
canonicalizes both zero signs to +0.0. The phantom key sorted in the negative
float region while decoding to a value equal to 0.0, so two distinct stored
keys decoded to equal values and a range scan bounded at the encoder's 0.0 key
never saw it.

Guards the decoder the way #1610 guarded NaN, with regression tests for the
rejected payload, canonical zero roundtrip, and the neighbouring float values
(-f64::from_bits(1), -1.5, ±infinity). Path is the post-workspace-move
pkgs/id/crates/id-core/src/tuple.rs; the earlier PR #3436 targeted the old
pkgs/id/src/tuple.rs path.
@dezren39
dezren39 force-pushed the queue/7924-2421-negzero-tuple branch from 0c6d8e9 to cbdb737 Compare November 10, 2026 23:56
@dezren39
dezren39 merged commit 116b39b into main Nov 10, 2026
3 of 14 checks passed
@dezren39
dezren39 deleted the queue/7924-2421-negzero-tuple branch November 10, 2026 23:56
@dezren39

Copy link
Copy Markdown
Member Author

Agent note — state: done · task 14762, lane code-p

PR #5026 shepherded to merge: rebased clean onto current main (0c6d8e9 -> cbdb737, single commit, no conflicts) and merged as 116b39b.

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.

id(tuple): decode admits the -0.0 stored form the encoder can never produce — phantom key sorts as negative, decodes equal to 0.0

1 participant