From e5899871dd55ceba2e1540ed0b77fcd795dc9dff Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Wed, 16 Apr 2025 17:30:39 -0400 Subject: [PATCH 1/4] Run CI on mac and windows on julia v1 at least this way we don't get hammered --- .github/workflows/CI.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3f8c2b28ca..2a54173be9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -25,6 +25,12 @@ jobs: - ubuntu-latest arch: - x64 + include: + - os: windows-latest + version: '1' + - os: macos-latest + version: '1' + arch: arm64 steps: - uses: actions/checkout@v2 - uses: julia-actions/cache@v1 From 8d738412880a19cbea3ea1cbe7eecb10b4086a21 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Wed, 16 Apr 2025 17:45:29 -0400 Subject: [PATCH 2/4] Use proj_context_destroy not proj_destroy That was causing the segfault it seems. --- ext/GeometryOpsProjExt/reproject.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/GeometryOpsProjExt/reproject.jl b/ext/GeometryOpsProjExt/reproject.jl index 30d3610ab9..6ec7a6226b 100644 --- a/ext/GeometryOpsProjExt/reproject.jl +++ b/ext/GeometryOpsProjExt/reproject.jl @@ -67,7 +67,7 @@ function reproject(geom, transform::Proj.Transformation; apply(functors, GI.PointTrait(), geom; kw1...) end # Destroy the temporary threading contexts that we created - Proj.proj_destroy.(contexts) + foreach(Proj.proj_context_destroy, contexts) # Return the results return results else From 6b6ad410b59cd7c2dd89212829c7f431eb076c53 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Wed, 16 Apr 2025 17:46:05 -0400 Subject: [PATCH 3/4] Clean up the code and remove allocations from broadcasting TODO: is it "safe" to use ntuple here? is nthreads a compile time constant? Not sure, we can leave that for later, but this is a nice note --- ext/GeometryOpsProjExt/reproject.jl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ext/GeometryOpsProjExt/reproject.jl b/ext/GeometryOpsProjExt/reproject.jl index 6ec7a6226b..0dad98a85e 100644 --- a/ext/GeometryOpsProjExt/reproject.jl +++ b/ext/GeometryOpsProjExt/reproject.jl @@ -52,12 +52,16 @@ function reproject(geom, transform::Proj.Transformation; if istrue(threaded) tasks_per_thread = 2 ntasks = Threads.nthreads() * tasks_per_thread + # Clone the transformation once for each task. + # Currently, these transformations live in the same context, but we will soon + # assign them to per-task contexts. + proj_transforms = [Proj.Transformation(Proj.proj_clone(transform.pj)) for _ in 1:ntasks] + # Construct one context per planned task contexts = [Proj.proj_context_clone(context) for _ in 1:ntasks] - # Clone the transformation for each context - proj_transforms = [Proj.Transformation(Proj.proj_clone(transform.pj)) for context in contexts] - # Assign the context to the transformation - Proj.proj_assign_context.(getproperty.(proj_transforms, :pj), contexts) + # Assign the context to the transformation. We use `foreach` here + # to avoid generating output where we don't have to. + foreach(Proj.proj_assign_context, getproperty.(proj_transforms, :pj), contexts) results = if _is3d(geom) functors = TaskFunctors(WithXYZ.(proj_transforms)) From 3e3aa866a2e55811ebe0796cdee5724551023944 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Wed, 16 Apr 2025 17:56:10 -0400 Subject: [PATCH 4/4] add arch on Win --- .github/workflows/CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2a54173be9..c295b7227a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -28,6 +28,7 @@ jobs: include: - os: windows-latest version: '1' + arch: x64 - os: macos-latest version: '1' arch: arm64