Skip to content

Island-based gradient breaks: 85% reduction in barriers#87

Merged
NewGraphEnvironment merged 1 commit intomainfrom
gradient-islands
Apr 5, 2026
Merged

Island-based gradient breaks: 85% reduction in barriers#87
NewGraphEnvironment merged 1 commit intomainfrom
gradient-islands

Conversation

@NewGraphEnvironment
Copy link
Copy Markdown
Owner

Summary

Replace interval-based gradient detection with vertex-based island approach (adapted from bcfishpass gradient_barriers_load.sql):

  • Compute gradient at every FWA vertex over 100m upstream window
  • Group consecutive above-threshold vertices into islands
  • Filter to islands >= 100m (sustained steep sections, not noise)
  • Return one break at the entry of each island (access barrier)

Entry-only breaks are correct for access barriers — everything upstream is blocked. Habitat classification uses segment attributes directly, not break presence.

Performance

Threshold Old (interval) New (island) Reduction
15% 28,960 4,229 85%
20% 24,823 4,097 83%
25% 21,295 3,824 82%

Test plan

  • devtools::test() — 528 pass, 0 fail
  • Code review — locale fix applied, single-vertex filter verified as intended
  • Single BLK validation: 13 noisy breaks → 5 clean barriers
  • ADMS-wide benchmarks at all access thresholds

Fixes #86
Relates to #83, #85
Relates to NewGraphEnvironment/sred-2025-2026#16

🤖 Generated with Claude Code

Replace interval-based gradient detection with vertex-based island
approach adapted from bcfishpass. Computes gradient at every FWA
vertex over a 100m upstream window, groups consecutive above-threshold
vertices into islands, filters to islands >= 100m, returns one break
at the entry of each island.

Access barriers only (entry point = everything upstream blocked).
Habitat classification uses segment attributes, not break presence.

ADMS benchmarks:
  15%: 28,960 → 4,229 barriers (85% reduction)
  20%: 24,823 → 4,097 barriers (83% reduction)
  25%: 21,295 → 3,824 barriers (82% reduction)

Fixes locale-dependent numeric formatting (format() vs %s).

Fixes #86
Relates to #83, #85

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@NewGraphEnvironment NewGraphEnvironment merged commit 64556c5 into main Apr 5, 2026
1 check passed
@NewGraphEnvironment NewGraphEnvironment deleted the gradient-islands branch April 5, 2026 17:42
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.

Island-based gradient breaks: entry + exit per steep section

1 participant