clockworklabs / clockworklabs/SpacetimeDB

support f32, f64 in index(btree)

Open
#5,279 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
Rust
Stars
25.2k
Forks
1.1k
Avg merge
2d 7h
Merged PRs (30d)
46

Description

it would be nice to support f32, f64 in index(btree) as it is the base for vectors and basically used everywhere in games.
i understand that there will always be a EPSILON uncertainty but i can live with that. the advantage of not having to store the position as i32, i64 and convert + div 1000 to get the position is more than worth the edge cases on the edge (pun intended).
i would even be fine if the index floats just get rounded to 0.01 precision and converted to i32/i64 (with * 100) to act as easy to compare value.

Requested by @xDovos via the SpacetimeDB site.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the btree index entry point and reviewing how existing numeric types are indexed and compared. No files or tests are named in the issue, and the acceptable f32/f64 representation and precision remain to be decided. Done should include a documented, tested approach for supporting both float types without breaking existing index behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.