Skip to content

Header-only coordijk.h v2#1154

Merged
ajfriend merged 3 commits intouber:masterfrom
ajfriend:aj/header-only-coordijk-v2
Apr 22, 2026
Merged

Header-only coordijk.h v2#1154
ajfriend merged 3 commits intouber:masterfrom
ajfriend:aj/header-only-coordijk-v2

Conversation

@ajfriend
Copy link
Copy Markdown
Collaborator

@ajfriend ajfriend commented Apr 17, 2026

Same as #1148, but cleaner git history.

Benchmarks comparing this PR to the current master, run with https://github.com/ajfriend/h3-index-bench:

                      Comparison (median of 300 samples)
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓
┃ Function                   ┃   master ┃ aj/header-only-coordijk-v2 ┃ Change ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩
│ latLngToCell               │ 0.1877us │                   0.1754us │  -6.6% │
│ cellToLatLng               │ 0.1024us │                   0.0894us │ -12.7% │
│ cellToBoundary             │ 0.4271us │                   0.3909us │  -8.5% │
│ directedEdgeToBoundary     │ 0.2417us │                   0.2009us │ -16.9% │
│ vertexToLatLng             │ 0.1434us │                   0.1192us │ -16.9% │
└────────────────────────────┴──────────┴────────────────────────────┴────────┘
     master=46ef6b953  aj/header-only-coordijk-v2=4cb98bf59  bench=7891697

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 99.162%. remained the same — ajfriend:aj/header-only-coordijk-v2 into uber:master

Comment thread CMakeLists.txt
Comment on lines +512 to +514
if(ENABLE_COVERAGE)
target_compile_definitions(${name} PRIVATE H3_COVERAGE_TEST=1)
endif()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is needed because some of the test executables call coordijk.h code directly?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, it's called from these:

  • testCoordIjkInternal.c
  • fuzzerInternalCoordIjk.c

Comment thread src/h3lib/lib/faceijk.c
// edge-crossing vertices as needed
g->numVerts = 0;
FaceIJK lastFijk;
FaceIJK lastFijk = {0};
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

For my info, what's the difference here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The previous build was just complaining about potentially using it uninitialized: https://github.com/uber/h3/actions/runs/24574942537/job/71857687680#step:6:82

But it's a false positive from moving this to the header; lastFijk is always initialized before use. This just silences the warning.

Copy link
Copy Markdown
Collaborator

@nrabinowitz nrabinowitz left a comment

Choose a reason for hiding this comment

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

LGTM - I didn't go over the code in detail, assuming that this was pure lift/shift rather than editing

Copy link
Copy Markdown
Collaborator

@dmitryzv dmitryzv left a comment

Choose a reason for hiding this comment

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

LGTM

@ajfriend
Copy link
Copy Markdown
Collaborator Author

LGTM - I didn't go over the code in detail, assuming that this was pure lift/shift rather than editing

Yup, exactly. And the things that weren't just cut and paste, I separated out into their own commits: 8829608 and 4cb98bf

@ajfriend ajfriend merged commit cd6eaba into uber:master Apr 22, 2026
47 checks passed
@ajfriend ajfriend deleted the aj/header-only-coordijk-v2 branch April 22, 2026 19:02
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.

6 participants