Radar performance assessment: EKF + RTS smoothing of a day of air traffic
/app/cpu/main.cpp is the source of a multicore CPU program (C++17, OpenMP).
The program takes one input-file path (PROGRAM INPUT_FILE) and writes its result to stdout.
What the program computes
A radar surveillance performance assessment, as done offline on a recorded day of air traffic: reconstruct a reference trajectory for every flight from the radar plots, then measure how each radar performs against it.
- Scenario (generated from
SEEDwithmix64, the SplitMix64 finaliser).Rrotating radars on a ring 250-320 km from the centre, each with a scan period of 16/20/32/40/48 ticks (1 tick = 0.25 s), a phase, a detection probability, range/azimuth noise and unknown range and azimuth biases (make_radar).Fflights, each with a start tick, a duration, a subset of radars that cover it and a smooth bounded truth trajectory (sum of two sinusoids per axis, closed-form position and velocity,make_flight/truth). - Plots. Radar
rlooks at a covered flight at ticksphase + k*periodinside the flight's window; scankgives a plot iffplot_key % 1000 < pd(integer decision). A plot is range = true range + bias + noise and azimuth =atan2+ bias + noise, the noise being a centred sum of four 32-bit hash uniforms (exact in double) timessqrt(3)and sigma. The plots of all covering radars are merged in (tick, radar) order. - Forward filter. Constant-velocity state (x, y, vx, vy), white-noise-acceleration process
noise of intensity
Q, one-point initialisation from the first plot (polar Jacobian position covariance, 250 m/s velocity sigma), then for each plot: predict overdt, EKF update with the polar measurement of that radar (nominal sigmas, biases unknown to the filter), azimuth innovation wrapped to (-pi, pi], covariance by the Joseph form. - Smoother. Rauch-Tung-Striebel pass backwards over the stored filtered states and covariances (gain via a 4x4 Cholesky solve of the predicted covariance).
- Statistics. Per radar: count, mean and standard deviation of range residuals (m) and azimuth residuals (microradians) of its plots against the smoothed trajectory - these estimate the radar's biases and noise. Per track-age bin (plot index within the flight, bins starting at 5, 10, 25, 50, 100, 250; the first 5 plots are excluded): filtered and smoothed position (m) and velocity (m/s) RMSE against the truth. ANEES (4-D NEES divided by 4) of filtered and smoothed estimates over the same plots. Four sample flights (indices 0, F/3, 2F/3, F-1): plot count, smoothed state at the first plot and at the last plot.
Per-flight sums are formed in plot order (backwards), added over chunks of 64 consecutive flights and the chunks are added in order. The work is double precision; reduced precision is not acceptable for the tolerance used.
Input format
One line: SEED R F SPAN LMIN LMAX Q - SEED 64-bit unsigned, 1 <= R <= 16,
0 <= F <= 200000, 1 <= SPAN <= 345600 (flight start ticks are in [0, SPAN)),
1 <= LMIN <= LMAX <= 115200 (flight duration in ticks), 0.1 <= Q <= 50 (decimal).
Output format
PLOTS <total> FLIGHTS <F>
RADAR r n mean_dr std_dr mean_daz_urad std_daz_urad (R lines)
AGE lo n filt_pos_rmse filt_vel_rmse smooth_pos_rmse smooth_vel_rmse (6 lines)
ANEES filtered smoothed
FLIGHT f n x0 y0 vx0 vy0 x1 y1 vx1 vy1 (4 lines, absent if F = 0)
Values are compared with relative tolerance 1e-7 and absolute tolerance 1e-3; counts must match.
Hidden inputs
Correctness inputs (12 files): F = 0, a single flight one tick long (no plots), a single
radar, 16 radars with 8-hour flights, simultaneous starts with fixed durations and Q = 0.1,
Q = 50, 300 very short flights, seed 0 and 2^64-1, and random settings with up to 400
flights. The timing input has 10 <= R <= 14, F about 85000*12/R (60k-100k flights),
SPAN = 345600, durations 2400-28800 ticks and 1 <= Q <= 4: about 3e8 plots in total.
Your task
Port this program to CUDA in /app/gpu/main.cu: same command line (PROGRAM INPUT_FILE),
same output on stdout. Then make it as fast as you can on the GPU while keeping the output correct.
The main computation must execute on the GPU. Renaming CPU code to .cu, running a
CPU fallback, or launching a dummy kernel while computing the answer on the CPU does not satisfy this task.
The CPU source is the specification: when this text and the code disagree, the code wins.
This sandbox is for writing the source only: it has g++ and the CPU program, but no CUDA
compiler and no GPU. Compilation, execution and verification happen later on an H100 in a
separate verifier, and a port that does not compile is rejected, so check your logic against
the CPU program before you finish (for example by emulating your kernels on the host).
How your port is verified
- Only
/app/gpu/main.cuis collected. It is compiled withnvcc -O3 -arch=sm_90 -std=c++17 -o port /app/gpu/main.cu; no extra libraries are linked. The CUDA runtime and the header-only libraries that ship with the CUDA toolkit (CUB, Thrust, libcu++) are allowed. - Your source must not contain any of:
system(,popen(,fork(,exec*,dlopen(,getenv(,#include <filesystem>,/tests/,/proc/. The program may read only the input file it is given. - Verification runs on one H100 in a fresh container without network. Hidden inputs are generated with a fresh random seed at verification time.
- Correctness: every hidden input (small edge cases plus a large timing input) must pass.
Your output must have the same tokens as the CPU program's output. Numeric tokens may differ by at most
atol + rtol*|expected|with rtol = 1e-07 and atol = 0.001; every other token must be identical. Any mismatch, crash or timeout is rejected. - GPU execution is checked: a port that computes its answer on the CPU is rejected even when its output is correct.
- Speed: The timing input has 10-14 radars and 60k-100k flights of 10 minutes to 2 hours over a 24-hour span, about 3e8 plots in total (each one filtered forward and smoothed backward).
/app/inputs/timing_example.inhas the shape and size of the hidden timing input. Your port is timed against a reference GPU port on it; the faster your port, the higher its score. /app/inputs/holds public input examples for understanding the input format.