Skip to content

Commit

Permalink
raycast: make degenerate warnings optional.
Browse files Browse the repository at this point in the history
since they werent reliable anyhow

also switch to 1.9 in project and ci
  • Loading branch information
axsk committed Oct 30, 2023
1 parent 2d43b5d commit b7352d1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1.9'
- 'nightly'
os:
- ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Polyhedra = "0.6, 0.7"
ProgressMeter = "1"
RecipesBase = "1"
StaticArrays = "0.12, 1"
julia = "1.6, 1.7"
julia = "1.9"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
9 changes: 6 additions & 3 deletions src/raycast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ function raycast(sig::Sigma, r::Point, u::Point, xs::Points, searcher::RaycastIn
return tau, t
end

global warn_degenerate::Bool = false

struct RaycastIncircleSkip{T}
tree::T
Expand Down Expand Up @@ -162,9 +163,11 @@ function raycast(sig::Sigma, r::Point, u::Point, xs::Points, searcher::RaycastIn

(j in sig || j == i) && break # converged to the smallest circle

# why is this test actually meaningful?
dold = sqrt(sum(abs2, x0-candidate))
isapprox(d, dold) && @warn "degenerate vertex at $sig + [$j]/[$i] ($d $dold)"
if warn_degenerate
# why is this test actually meaningful?
dold = sqrt(sum(abs2, x0 - candidate))
isapprox(d, dold) && @warn "degenerate vertex at $sig + [$j]/[$i] ($d $dold)"
end

i = j
end
Expand Down

2 comments on commit b7352d1

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Julia benchmark result

Benchmark suite Current: b7352d1 Previous: e4b0fac Ratio
2/100 363002 ns 368703 ns 0.98
2/1000 4818277.5 ns 3704629 ns 1.30
3/100 1453559 ns 1155710 ns 1.26
3/1000 23453889 ns 17058748 ns 1.37
4/100 6285186 ns 4754437 ns 1.32
4/1000 152236069 ns 113580391 ns 1.34
5/100 31819542 ns 20699776 ns 1.54
5/1000 1148591136 ns 823220794 ns 1.40

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Julia benchmark result'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: b7352d1 Previous: e4b0fac Ratio
2/1000 4818277.5 ns 3704629 ns 1.30
3/100 1453559 ns 1155710 ns 1.26
3/1000 23453889 ns 17058748 ns 1.37
4/100 6285186 ns 4754437 ns 1.32
4/1000 152236069 ns 113580391 ns 1.34
5/100 31819542 ns 20699776 ns 1.54
5/1000 1148591136 ns 823220794 ns 1.40

This comment was automatically generated by workflow using github-action-benchmark.

CC: @axsk

Please sign in to comment.