Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,33 @@ jobs:
env:
GROUP: ${{ matrix.group }}

test-protection-levels:
name: Protection Levels - Julia ${{ matrix.version }}
runs-on: ${{ vars.USE_SELF_HOSTED == 'true' && 'self-hosted' || 'ubuntu-latest' }}
timeout-minutes: 60
permissions:
actions: write
contents: read
strategy:
fail-fast: false
matrix:
version:
- '1'
- '1.12'
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
- uses: julia-actions/cache@v2
- name: Test RunwayLibProtectionLevels
run: |
julia --project=libs/RunwayLibProtectionLevels -e '
using Pkg
Pkg.instantiate()
Pkg.test()
'

python-smoke-test:
name: Python Interface Smoke Test - Julia ${{ matrix.version }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -71,3 +98,21 @@ jobs:
run: |
export UV_PYTHON="$MAMBA_ROOT_PREFIX/envs/test/bin/python"
uv run smoke_test.py # installs env automatically

pluto-notebooks:
name: Pluto Notebooks
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1.13'
include-all-prereleases: true
- uses: julia-actions/cache@v2
- name: Install Pluto
run: julia -e 'using Pkg; Pkg.add("Pluto")'
- name: Run Pluto notebook tests
run: julia test/pluto_notebooks/run_notebook_tests.jl
env:
RUNWAYLIB_PKGDIR: ${{ github.workspace }}
10 changes: 9 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ version = "0.1.0"
authors = ["Romeo Valentin <romeov@stanford.edu>"]

[workspace]
projects = ["test", "benchmark", "juliac", "docs"]
projects = ["test", "benchmark", "juliac", "docs", "libs/RunwayLibProtectionLevels"]

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
BracketingNonlinearSolve = "70df07ce-3d50-431d-a3e7-ca6ddb60ac1e"
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
Expand All @@ -22,9 +23,12 @@ LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
Moshi = "2e0e35c7-a2e4-4343-998d-7ef72827ed2d"
NonlinearSolveBase = "be0214bd-f91f-a760-ac4e-3421ce2b2da0"
NonlinearSolveFirstOrder = "5959db7a-ea39-4486-b5fe-2dd0bf03d60d"
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e"
Polyester = "f517fe37-dbe3-4b94-8317-1923a5111588"
PolyesterWeave = "1d0040c9-8b98-4ee7-8388-3f51789ca0ad"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
ProbabilisticParameterEstimators = "0098cf3f-3e1e-4f11-b01c-dd9dec1b3374"
Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
Expand All @@ -44,6 +48,7 @@ PythonCallExt = "PythonCall"
[compat]
ADTypes = "1.16.0"
BenchmarkTools = "1.6.0"
BracketingNonlinearSolve = "1.5.0"
CEnum = "0.5.0"
CSV = "0.10"
DiffEqBase = "^6.179.0"
Expand All @@ -57,9 +62,12 @@ LinearSolve = "3.25.0"
Moshi = "0.3.7"
NonlinearSolveBase = "1.13.0,2"
NonlinearSolveFirstOrder = "1.8.0"
Optimization = "5.4.0"
OptimizationOptimJL = "0.4.9"
Polyester = "0.7.18"
PolyesterWeave = "0.2.2"
PrecompileTools = "1"
Printf = "1.11.0"
ProbabilisticParameterEstimators = "0.8.3"
PythonCall = "0.9"
Rotations = "1"
Expand Down
28 changes: 28 additions & 0 deletions libs/RunwayLibProtectionLevels/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name = "RunwayLibProtectionLevels"
uuid = "e8295940-cb7e-45e5-ae62-4728616c04bd"
version = "0.1.0"
authors = ["Romeo Valentin <romeov@stanford.edu>"]

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
BracketingNonlinearSolve = "70df07ce-3d50-431d-a3e7-ca6ddb60ac1e"
Chairmarks = "0ca39b1e-fe0b-4e98-acfc-b1656634c4de"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
NonlinearSolveFirstOrder = "5959db7a-ea39-4486-b5fe-2dd0bf03d60d"
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
OptimizationIpopt = "43fad042-7963-4b32-ab19-e2a4f9a67124"
OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"
RunwayLib = "c31d23ff-e9b5-4186-8ef8-ce4d62614c67"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[compat]
Chairmarks = "1.3.1"
OptimizationIpopt = "1.1.0"
julia = "1.11"
45 changes: 45 additions & 0 deletions libs/RunwayLibProtectionLevels/benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using RunwayLibProtectionLevels
using RunwayLib
using Chairmarks
using Unitful, Unitful.DefaultSymbols
using StaticArrays
using Rotations: RotZYX
using LinearAlgebra
using Random

# --- Setup: representative scenario ---
rng = MersenneTwister(42)
runway_corners = SA[
WorldPoint(0.0m, -25.0m, 0.0m),
WorldPoint(0.0m, 25.0m, 0.0m),
WorldPoint(1500.0m, -25.0m, 0.0m),
WorldPoint(1500.0m, 25.0m, 0.0m),
]
px_std = sqrt(2.0)
noise_cov = Diagonal(px_std^2 * ones(8))
cam_pos = WorldPoint(-2500.0m, 10.0m, 250.0m)
cam_rot = RotZYX(0.02, 0.05, 0.01)
clean_obs = [project(cam_pos, cam_rot, c) for c in runway_corners]
noisy_obs = clean_obs .+ [ProjectionPoint(px_std * randn(rng, 2)RunwayLib.px) for _ in clean_obs]

# Warmup
compute_zero_fault_protection_level_grad(runway_corners, noisy_obs, noise_cov, cam_rot; alpha_idx=1, prob=0.01)

# --- Benchmarks ---
println("PL both directions (along-track):")
display(@be compute_zero_fault_protection_level_grad(
runway_corners, noisy_obs, noise_cov, cam_rot;
alpha_idx=1, direction=0, prob=0.01,
) evals=1 samples=20 seconds=60)

println("\nPL single direction (along-track, hi):")
display(@be compute_zero_fault_protection_level_grad(
runway_corners, noisy_obs, noise_cov, cam_rot;
alpha_idx=1, direction=1, prob=0.01,
) evals=1 samples=20 seconds=60)

println("\nPL both directions (cross-track):")
display(@be compute_zero_fault_protection_level_grad(
runway_corners, noisy_obs, noise_cov, cam_rot;
alpha_idx=2, direction=0, prob=0.01,
) evals=1 samples=20 seconds=60)
Loading
Loading