Configuration reference¶
- class TrackGenConfig[source]¶
Bases:
objectSingle configuration object passed to every stage of the pipeline.
Fields configure the fixed-shape Warp pipeline. Scalar style knobs are used by default; opt-in per-env style sampling is available through
style_samplingand the*_rangefields for the Bezier generator. Onlyrelax_solver="xpbd"is used by the runtime path; theenergy_*,tp_*, andsmooth_finish*fields serve the torch oracle backends intests/_oracle/and are not used by TrackGenerator. The Fourier fields (num_harmonics,decay_p,amplitude,num_centerline_samples) are retained only for compatibility withtrack_gen._experimental.fourierand older experiment sweeps.- generator¶
Registered generator name. One of
"bezier"(default),"hull","polar","voronoi", or"checkpoint". Resolved throughtrack_gen._src.generator_registryatTrackGeneratorconstruction time.- Type:
- device¶
Warp device string:
"cpu"(GPU-free, for tests/CI) or"cuda"(captures a replay graph on firstgenerate()call).- Type:
- num_envs¶
Number of environments in the batch. Must be >= 1. Determines the leading dimension of all output arrays.
- Type:
- min_num_points¶
Minimum Bezier/hull corner-anchor count per env. Must be >= 2. Shared by the
"bezier"and"hull"generators; feedswp.randiwith the range[min_num_points, max_num_points].- Type:
- max_num_points¶
Maximum corner-anchor count per env. Must be >=
min_num_points. A wider range adds more per-env diversity in corner count.- Type:
- num_points_per_segment¶
Dense Bezier (or Catmull-Rom) samples emitted per corner-to-corner segment before arc-resampling to
num_points. Must be >= 2; higher values give the arc-resampler a finer cumulative-arc-length grid, reducing interpolation error.- Type:
- min_point_distance¶
Minimum grid-cell spacing for corner-position sampling. Must be in
(0, 0.5]. Governs the cell grid asnum_cells = int(1 / (min_point_distance * 2)).- Type:
- min_angle¶
Minimum interior angle (radians) at constrained Bezier corners; default ~0.218 rad (12.5 deg). Used by the gate-angle validity kernel in
warp_generate.py; not applied directly to track-centerline generation.- Type:
- rad¶
Cubic-Bezier handle length as a fraction of the segment chord — the primary curviness dial. Typical range
[0.2, 0.6]. Only live whenrad <= handle_clamp_frac; ifradexceeds the clamp,handle_clamp_fracbinds every segment andradhas no effect (seehandle_clamp_frac).- Type:
- edgy¶
Corner-tangent blend weight. Converted internally as
p = atan(edgy) / pi + 0.5. At 0.0 (default),p = 0.5gives a symmetric bisector tangent; larger positive values pushptoward 1, making turns asymmetrically sharper (outgoing-edge-dominant).- Type:
- scale¶
Isotropic scale multiplier applied to sampled corner positions. Scales all track coordinates; interacts with
spacingandhalf_widththrough the coordinate range.- Type:
- handle_clamp_frac¶
Adaptive Bezier-handle clamp. Each corner’s handle is capped at
handle_clamp_frac * (its shorter incident edge)to prevent overshoot past a nearby corner. Set equal torad(the default) so the clamp only trims genuine overshoot; set belowradto bind every handle regardless ofrad(producing near-polygonal tracks); set very large to disable. Tracks that still self-cross after clamping fall back to their corner polygon (~5% at 0.4), which XPBD re-rounds.- Type:
- hull_displacement¶
Hull generator only. Maximum per-edge radial midpoint displacement as a fraction of the centroid-to-midpoint distance. At 0.0 the method collapses toward a plain angle-sorted loop; larger values (typical range
[0.1, 0.4]) bulge or pinch lobes for more racing-shape variety, at the cost of a higher downstream relaxation burden.- Type:
- checkpoint_count¶
Checkpoint generator only. Number of radial checkpoints (
C). Must be >= 3. More checkpoints produce wavier tracks (chicane count scales ~C); fewer produce calmer, rounder tracks. CarRacing canonical default: 12.- Type:
- checkpoint_radius_min_frac¶
Inner-radius fraction for checkpoint placement. Checkpoint radii are drawn from
U(checkpoint_radius_min_frac * R, R)whereR = 1. Must be in[0, 1). The CarRacing canonical value 0.33 gives the inlets.- Type:
- checkpoint_angle_jitter¶
Angular jitter as a fraction of the per-checkpoint angular slot (
slot = 2*pi/C). Kept below 1.0 so the checkpoint sequence stays angle-monotone, ensuring the steered path winds once around. Default 0.55.- Type:
- checkpoint_turn_rate¶
Maximum heading change (radians) per steering step. Bounds path curvature; too large allows kinks, too small prevents tracking the inlets. Default 0.42.
- Type:
- checkpoint_steer_gain¶
Proportional steering gain toward the current target bearing, in
(0, 1]. Controls how aggressively the heading chases each checkpoint per step, coupled to one lap by the fixed step lengthdl. Default 0.65.- Type:
- checkpoint_lookahead_frac¶
Advance-to-next-checkpoint threshold as a fraction of outer radius
R. The path moves to the next checkpoint once withincheckpoint_lookahead_frac * Rof the current target, keeping flow from stalling at each checkpoint. Default 0.16.- Type:
- checkpoint_best_of_k¶
Best-of-K candidate count. Must be >= 1. Generates
Kdecorrelated candidates per env and keeps the one with the fewest self-intersections (deterministic argmin; ties broken by lowestk). Replaces CarRacing’s unbounded reject-retry with a bounded, graph-capturable pool; K=4 leaves ≲0.4% of tracks with a pre-relax self-intersection at the default config.- Type:
- checkpoint_clip_fallback¶
Opt-in single-crossing clip fallback (default
False). WhenTrue, the first self-crossing of the selected centerline is clipped: split at the intersection point, keep the longer sub-loop arc, resample tonum_points. A capture-time Python branch; the captured graph stays fixed either way.- Type:
- style_sampling¶
Opt-in per-env Bezier style randomisation (default
False). WhenFalse, the scalarrad/scale/handle_clamp_fracare used for all envs unchanged. WhenTrue, each env draws its own values from the*_rangefields via the per-env Warp RNG, so a single batch spans a family of styles. Resolved at CUDA-graph capture time (a Python branch); per-env values are device data so the captured graph remains fixed.- Type:
- rad_range¶
(lo, hi)range for per-envradwhenstyle_sampling=True.Nonecollapses to the scalarradfor all envs.
- scale_range¶
(lo, hi)range for per-envscalewhenstyle_sampling=True.Nonecollapses to the scalarscalefor all envs.
- handle_clamp_frac_range¶
(lo, hi)range for per-envhandle_clamp_fracwhenstyle_sampling=True.Nonecollapses to the scalarhandle_clamp_fracfor all envs.
- polar_num_knots¶
Polar generator only. Number of periodic cubic-spline control knots. More knots add higher-frequency shape variety. Default 12.
- Type:
- polar_radial_jitter¶
Polar generator only. Radial jitter magnitude for polar control knots, as a fraction of the base radius. Clamped internally to keep radii positive; larger values produce more eccentric track shapes. Default 0.60.
- Type:
- polar_angular_jitter¶
Polar generator only. Angular jitter per polar knot, as a fraction of a half angular cell, so the sorted order is preserved without a runtime sort. Larger values add more angular irregularity. Default 0.30.
- Type:
- voronoi_num_sites¶
Voronoi generator only. Total cell sites in the fixed site field. Must be >=
voronoi_control_points. More sites enrich anchor-snap targets at the cost of a larger all-sites scan. Default 256.- Type:
- voronoi_site_layout¶
Voronoi generator only. Site distribution layout. One of
"ring"(uniform box fill — NOT an annular band; name kept for config compatibility),"void_ring"(default — annular band with center void, r ∈ [0.14·box, 0.52·box], biased for usable closed loops),"clustered"(6 radial Gaussian clusters with ~22% annular fallback per site), or"mixed"(65% annular sites blended with 35% uniform box fill).- Type:
- voronoi_control_points¶
Voronoi generator only. Number of angular anchor sites selected from the site field (
K). Must be >= 6 for Chaikin/Catmull-Rom densification to produce a smooth loop. More control points add local features and can raise the downstream relaxation burden.- Type:
- voronoi_radial_variation¶
Voronoi generator only. Radial modulation of anchor target positions. Must be >= 0. At 0, all targets are placed at a uniform annulus radius; larger values allow more eccentric loops. Default 0.62.
- Type:
- voronoi_angular_jitter¶
Voronoi generator only. Angular jitter for anchor sector targets, as a fraction of a full sector. Must be >= 0. Larger values randomise the angular spacing of targets. Default 0.08.
- Type:
- repulsive_grow_mult_min¶
Repulsive generator only. Lower bound of the per-env target-perimeter multiplier draw
U(min, max): the grown loop’s target perimeter isgrow_mult * 2π * r_init. Higher → denser mazes at some yield cost.Warning
The
repulsivegenerator is a host-driven, non-graph-capturable optimizer — roughly 1000× slower thanbezier(~0.18 s @ E=64, ~5.1 s @ E=8192 on an RTX 4090, vs ~2 ms for bezier). It runs eagerly on CUDA every call (no captured replay). Regenerate on a slow cadence or in staggered per-env slices, not every frame.- Type:
- repulsive_grow_mult_max¶
Repulsive generator only. Upper bound of the target-perimeter multiplier draw. Must be >=
repulsive_grow_mult_min. Overfill ratio ≈grow_mult / repulsive_domain_init_ratio.- Type:
- repulsive_domain_frac¶
Repulsive generator only. Confinement-disc radius as a fraction of the world-scale reference length (
r_dom = repulsive_domain_frac * scale_ref * config.scale). Sets the grown curve’s absolute scale vshalf_width. Must be > 0. Tighter → richer folds.- Type:
- repulsive_domain_init_ratio¶
Repulsive generator only. Ratio
r_dom / r_initof the domain radius to the initial seed-circle radius. Must be > 1. Reference value 4.0.- Type:
- repulsive_obstacle_count_min¶
Repulsive generator only. Lower bound of the per-env inner-disc obstacle count
k ~ randi[min, max]. Must be >= 1.- Type:
- repulsive_obstacle_count_max¶
Repulsive generator only. Upper bound of the inner-disc count. Must be >=
repulsive_obstacle_count_min.- Type:
- repulsive_obstacle_radius_min_frac¶
Repulsive generator only. Lower bound of the inner-disc radius as a fraction of
r_dom. Must be > 0.- Type:
- repulsive_obstacle_radius_max_frac¶
Repulsive generator only. Upper bound of the inner-disc radius fraction. Must be >=
repulsive_obstacle_radius_min_frac.- Type:
- repulsive_ratchet_rate¶
Repulsive generator only. Per-iteration length-growth factor of the hard ratchet. Must be > 0.
<= 0.013holds full yield with folds;>= 0.016collapses the folds (physical limit).- Type:
- repulsive_alpha¶
Repulsive generator only. Tangent-point energy exponent alpha. Must be > 0.
- Type:
- repulsive_beta¶
Repulsive generator only. Tangent-point energy exponent beta; obstacle inverse power is
p = beta - alpha. Must be > 0.- Type:
- repulsive_w_len¶
Repulsive generator only. Weight of the small inert length regularizer.
- Type:
- repulsive_stages¶
Repulsive generator only. Coarse-to-fine resolution schedule
N = 64 → 128 → 256. Must be non-empty, strictly increasing, and each a positive multiple of 4. The last entry must equalnum_points(the tail input resolution) whengenerator == "repulsive".
- repulsive_settle_iters¶
Repulsive generator only. Settle-phase iteration budget above the ratchet.
- Type:
- repulsive_resample_every¶
Repulsive generator only. Periodic arc-length reparameterization interval.
- Type:
- repulsive_stall_window¶
Repulsive generator only. Iterations between stall checks / early-exit readbacks.
- Type:
- repulsive_stall_area_tol¶
Repulsive generator only. Freeze an env once it is past target length AND its enclosed-area relative change over a stall window is below this (reparameterization-invariant shape-convergence tolerance).
- Type:
- repulsive_deactivate_obstacles¶
Repulsive generator only. When
True(default), zero the inner-disc obstacle weights once an env reaches its target length (the wall stays live), closing the disc halos.- Type:
- num_harmonics¶
Fourier / experimental — not used by the runtime path. Number of Fourier harmonics (
K). Retained for compatibility withtrack_gen._experimental.fourierand older sweeps.- Type:
- decay_p¶
Fourier / experimental — not used by the runtime path. Fourier amplitude decay exponent: amplitude ~
amp / k ** decay_p.- Type:
- amplitude¶
Fourier / experimental — not used by the runtime path. Fourier base amplitude.
- Type:
- num_centerline_samples¶
Fourier / experimental — not used by the runtime path. Dense sample count for the Fourier generator (
M_max).- Type:
- half_width¶
Track half-width in the same coordinate units as the centerline. Must be > 0. All spacing, relaxation, and inflation distances couple to this value:
spacingdefaults to0.6 * half_width; the XPBD separation target is2 * half_width * (1 + relax_margin);N_maxheadroom scales with1 / half_widthat a given track scale.- Type:
- relax_enable¶
When
True(default), the XPBD relaxation solve runs before inflation. WhenFalse, the constant-spacing centerline is inflated directly; useful for ablation studies but typically produces lower-quality tracks.- Type:
- relax_solver¶
Backend selector. Only
"xpbd"is used by the runtime path (TrackGenerator)."energy"(Adam) and"tp_sobolev"are oracle-only backends intests/_oracle/relaxation.py;TrackGeneratorrejects any solver other than"xpbd"at construction time.- Type:
- relax_chunk_size¶
Energy oracle backend only — not used by the runtime path. Env-chunk size for the dense
[E, N, N]interaction term in the energy backend.Nonedisables chunking.- Type:
int or None
- relax_use_warp¶
Oracle-only — not used by the runtime path. When
False, oracle tests redirect relaxation to the pure-torch path instead of Warp. Ignored byTrackGeneratorandwarp_relax.py.- Type:
bool or None
- relax_tol¶
Validity thickness tolerance. The minimum valid track half-width is
(1 - relax_tol) * half_width. Default 0.02 (2% tolerance).- Type:
- relax_band¶
Bead-index exclusion band for the separation constraint.
None(default) auto-computesround(2 * half_width / L0)per track, whereL0is the rest edge length. Set explicitly to override the per-track auto-band.- Type:
int or None
- relax_iters¶
Number of XPBD Jacobi sweeps. Default 50. Each sweep applies separation, spacing, and bending corrections; with the default Chebyshev-accelerated solve (
relax_accel="chebyshev"), 50 sweeps are calibrated for ~0.999 end-to-end valid yield at the library defaults (matching what 150 plain Jacobi sweeps used to need).- Type:
- relax_accel¶
Iteration-acceleration scheme for the XPBD Jacobi sweeps.
"chebyshev"(default) applies Chebyshev semi-iterative acceleration (Macklin et al. 2014): afterrelax_cheby_startplain warmup sweeps, each sweep blends the Jacobi update with the current and previous iterates using a host-precomputed omega recurrence, converging ~3x faster per sweep."none"runs plain damped Jacobi (the legacy behaviour).- Type:
- relax_cheby_rho¶
Chebyshev spectral-radius estimate of the underlying Jacobi iteration. Must be in
[0, 1). Default 0.98. Larger values accelerate the long-wavelength modes harder but risk overshoot on the nonsmooth separation contacts; values >= 0.99 were observed to reduce yield.- Type:
- relax_cheby_gamma¶
Chebyshev under-relaxation factor applied to the Jacobi step inside the blend. Must be in
(0, 1]. Default 0.9. Values below 1 damp the contact-switching noise that acceleration would otherwise amplify.- Type:
- relax_cheby_start¶
Sweep index at which Chebyshev acceleration engages; earlier sweeps run plain Jacobi so the separation contact set settles first. Must be >= 1. Default 8.
- Type:
- relax_smooth_passes¶
Number of shrink-free Taubin smoothing passes applied after the main sweep loop. Must be >= 0. Default 5. Each pass is two Laplacian half-steps (\(\lambda > 0\) then \(\mu < -\lambda\)), which removes the sub-
R_mincurvature noise the bending guard’s deadband cannot see (bending only fires below the minimum radius; gentler wiggles are invisible to all three constraints) without shrinking corners through the validity gate the way a plain Laplacian would. 0 disables the smoothing tail entirely.- Type:
- relax_smooth_spacing_iters¶
Number of spacing-only polish sweeps applied after the Taubin passes. Must be >= 0. Default 10. Each is the ordinary edge-spacing correction with separation and bending off, restoring bead uniformity that the Taubin passes perturb. 0 disables the polish.
- Type:
- relax_sep_every¶
Broadphase refresh interval in sweeps. Must be >= 1. At 1, the dense
O(count²)separation scan (or cache rebuild) runs every sweep. AtK > 1withrelax_sep_cache_slots == 0, the dense scan is skipped between refreshes (fast but may miss transient contacts). Withrelax_sep_cache_slots > 0, this is the cache-rebuild interval; the exact narrowphase still runs every sweep on cached candidates. Default 20: the broadphase is built at sweep 0 and refreshed only at multiples of this interval, so runs shorter thanrelax_sep_everysweeps never refresh it mid-solve — the cadence dropped from 40 alongside therelax_iters150 -> 50 default so the accelerated solve still refreshes mid-solve.- Type:
- relax_sep_cache_slots¶
Broadphase candidate cache capacity per bead. 0 disables the cache (uses the dense cadenced scan). When > 0, each bead stores up to this many non-neighbour candidate indices; the exact separation push runs against cached candidates every sweep. Larger values reduce missed contacts at the cost of memory and narrowphase work. Default 16.
- Type:
- relax_sep_cache_skin¶
Broadphase skin as a fraction of the exact separation target. Must be >= 0. The cache stores candidates within
target * (1 + skin); the exact narrowphase test still requiresdist < target. Skin 0 is fastest; positive values retain candidates that may enter contact during a long cache interval. Default 0.5.- Type:
- relax_sep_relax¶
Scale applied to the separation-constraint correction. Default 1.0 (full correction). Reduce toward 0 to soften separation enforcement.
- Type:
- relax_spc_relax¶
Scale applied to the edge-spacing (rest-length) correction. Default 1.0. Reduce to allow more spacing deviation.
- Type:
- relax_bend_relax¶
Scale applied to the bending/radius-guard correction. Default 1.5 (slightly over-corrects to quickly remove sharp corners introduced by separation pushes). Reduce if the solver oscillates.
- Type:
- relax_margin¶
Fractional expansion of the separation target beyond the road diameter:
target = 2 * half_width * (1 + relax_margin). Default 0.15 (15% margin). Leaves room for the downstream thickness validity gate.- Type:
- energy_steps¶
Energy oracle backend — not used by the runtime path. Adam optimiser steps for the
"energy"oracle backend intests/_oracle/relaxation.py.- Type:
- energy_w_sep¶
Energy oracle backend — not used by the runtime path. Separation loss weight.
- Type:
- energy_w_len¶
Energy oracle backend — not used by the runtime path. Edge-length loss weight.
- Type:
- energy_w_bend¶
Energy oracle backend — not used by the runtime path. Bending loss weight.
- Type:
- energy_w_anchor¶
Energy oracle backend — not used by the runtime path. Anchor loss weight.
- Type:
- tp_iters¶
TP-Sobolev oracle backend — not used by the runtime path. Flow steps for the
"tp_sobolev"oracle backend intests/_oracle/relaxation.py.- Type:
- tp_tau¶
TP-Sobolev oracle backend — not used by the runtime path. Step size for the TP-Sobolev flow.
- Type:
- tp_alpha¶
TP-Sobolev oracle backend — not used by the runtime path. Sobolev kernel exponent alpha; shared with the
smooth_finishfinisher.- Type:
- tp_beta¶
TP-Sobolev oracle backend — not used by the runtime path. Sobolev kernel exponent beta; shared with the
smooth_finishfinisher.- Type:
- smooth_finish¶
Oracle-only — not used by the runtime path. When
True, a tangent-point/Sobolev smoothing finisher runs after the primary relaxation solve.TrackGeneratorrejectssmooth_finish=Trueat construction time.- Type:
- smooth_finish_iters¶
Oracle-only — not used by the runtime path. Flow steps for the smoothing finisher.
- Type:
- smooth_finish_tau¶
Oracle-only — not used by the runtime path. Step size for the smoothing finisher.
- Type:
- num_points¶
Intermediate dense-resample resolution (
N) used before the constant-spacing step. Default 256. The constant-spacing resampler then derivescount[e] = floor(perimeter / spacing) + 1real points per env.- Type:
- output_mode¶
Output resampling mode. The only supported value is
"constant_spacing"(enforced by__post_init__). Constant arc spacing produces smoother XPBD convergence and higher valid-track yield than a fixed point count.- Type:
- spacing¶
Constant arc-length step (m) between adjacent output points.
None(default) auto-couples to0.6 * half_width— the relaxation-friendly value; a fixed default would be wrong ashalf_widthvaries. Must resolve to > 0 after auto-coupling.- Type:
float or None
- N_max¶
Output buffer width: maximum constant-spacing points per track. Tracks whose true
count[e]exceedsN_maxare truncated and fail validity. Default 384: ample headroom athalf_width = 0.1(spacing ≈ 0.06, ~141 max points), full coverage tohalf_width ≈ 0.05(~281 max), and ~98% of thehalf_width = 0.03regime (~468 max). RaiseN_maxor coarsenspacingfor finer/larger-scale regimes.- Type:
- max_regen_iters¶
Vestigial on the Warp runtime path. Maximum regeneration iterations for the torch oracle’s accept-first-valid loop in
tests/_oracle/generators.py. Ignored by_run_pipeline, which is single-pass with no host-side retry loop.- Type:
- turning_tol¶
Absolute angular tolerance in radians for the turning-number validity gate. Tracks whose signed curvature integral deviates from the expected full turn by more than this tolerance are marked invalid. Default 0.1.
- Type:
- w_floor¶
Width floor for validity. Every real track point must have computed half-width >
w_floor. Default1e-3. Guards against near-degenerate geometry that passes the global thickness check.- Type:
- validity_border_check¶
When
True, an explicit border self-intersection check is added to the validity gate. DefaultFalse. Redundant with the thickness/separation gate (a self-crossing fat band drivesseparation_min → 0 → thickness < half_width → invalid), so the default saves twoO(N²)passes with no change to the valid mask.- Type:
- z_profile¶
Per-point altitude (Z) profile family, applied along the resampled constant-spacing centerline arc length. One of
"flat"(default, every real point atz_base),"uniform"(i.i.d. uniform in[z_min, z_max]),"random_walk"(Brownian-bridge walk clamped to[z_min, z_max]with a per-step grade cap ofz_max_step), or"noise"(periodic harmonic noise aroundz_base). Applied bywarp_zprofile.apply_z_profileon the resampler’s(cum, perim)plan-view arc tables.- Type:
- z_base¶
Baseline altitude for the
"flat","random_walk", and"noise"profiles. Default 0.0.- Type:
- z_min¶
Lower altitude clamp for
"uniform","random_walk", and"noise". Must be <=z_max. Default 0.0.- Type:
- z_max¶
Upper altitude clamp for
"uniform","random_walk", and"noise". Must be >=z_min. Default 0.0.- Type:
- z_max_step¶
Random-walk profile only. Maximum
|dz|per unit plan-view arc length (a grade cap), applied per random-walk step before the closure bridge. Must be >= 0. Default 0.0.- Type:
- z_noise_amplitude¶
Noise profile only. Amplitude of the harmonic altitude oscillation around
z_base. Must be >= 0. Default 0.0.- Type:
- z_noise_harmonics¶
Noise profile only. Number of summed harmonics in the periodic noise field. Must be >= 1. Default 3.
- Type:
- z_control_points¶
Number of arc-length-spaced altitude control knots. Altitude is decided at these knots and interpolated between them with a periodic monotone cubic, so smoothness is independent of the resampled point count. Must be >= 3. Applies to
z_profile="uniform"and"random_walk"; inert for"flat"(constant) and"noise"(analytically smooth — usez_noise_harmonicsfor its frequency). Default 10.- Type:
- z_valid_grade¶
Maximum allowed
|dz|/ds grade for post-hoc course validity checking, wheredsis measured along the PLAN-VIEW (XY) arc length, not the 3D lifted arc length. 0 disables the check. Must be >= 0. Default 0.0.- Type:
- __init__(generator='bezier', device='cpu', num_envs=1, min_num_points=9, max_num_points=13, num_points_per_segment=30, min_point_distance=0.05, min_angle=0.2181661564992912, rad=0.4, edgy=0.0, scale=1.0, handle_clamp_frac=0.4, hull_displacement=0.15, checkpoint_count=12, checkpoint_radius_min_frac=0.33, checkpoint_angle_jitter=0.55, checkpoint_turn_rate=0.42, checkpoint_steer_gain=0.65, checkpoint_lookahead_frac=0.16, checkpoint_best_of_k=4, checkpoint_clip_fallback=False, style_sampling=False, rad_range=None, scale_range=None, handle_clamp_frac_range=None, polar_num_knots=12, polar_radial_jitter=0.6, polar_angular_jitter=0.3, voronoi_num_sites=256, voronoi_site_layout='void_ring', voronoi_control_points=18, voronoi_radial_variation=0.62, voronoi_angular_jitter=0.08, repulsive_grow_mult_min=4.5, repulsive_grow_mult_max=5.5, repulsive_domain_frac=0.35, repulsive_domain_init_ratio=4.0, repulsive_obstacle_count_min=8, repulsive_obstacle_count_max=12, repulsive_obstacle_radius_min_frac=0.02, repulsive_obstacle_radius_max_frac=0.045, repulsive_ratchet_rate=0.012, repulsive_alpha=3.0, repulsive_beta=6.0, repulsive_tau=0.4, repulsive_w_len=30.0, repulsive_stages=(64, 128, 256), repulsive_settle_iters=40, repulsive_resample_every=25, repulsive_stall_window=16, repulsive_stall_area_tol=0.05, repulsive_deactivate_obstacles=True, num_harmonics=5, decay_p=2, amplitude=1.0, num_centerline_samples=256, half_width=0.1, relax_enable=True, relax_solver='xpbd', relax_chunk_size=None, relax_use_warp=None, relax_tol=0.02, relax_band=None, relax_iters=50, relax_accel='chebyshev', relax_cheby_rho=0.98, relax_cheby_gamma=0.9, relax_cheby_start=8, relax_smooth_passes=5, relax_smooth_spacing_iters=10, relax_sep_every=20, relax_sep_cache_slots=16, relax_sep_cache_skin=0.5, relax_sep_relax=1.0, relax_spc_relax=1.0, relax_bend_relax=1.5, relax_margin=0.15, energy_steps=800, energy_lr=0.003, energy_w_sep=80.0, energy_w_len=8.0, energy_w_bend=1.0, energy_w_anchor=0.01, tp_iters=100, tp_tau=0.7, tp_alpha=2.0, tp_beta=4.5, smooth_finish=False, smooth_finish_iters=8, smooth_finish_tau=0.2, num_points=256, output_mode='constant_spacing', spacing=None, N_max=384, max_regen_iters=10, turning_tol=0.1, w_floor=0.001, validity_border_check=False, z_profile='flat', z_base=0.0, z_min=0.0, z_max=0.0, z_max_step=0.0, z_noise_amplitude=0.0, z_noise_harmonics=3, z_control_points=10, z_valid_grade=0.0)¶
- Parameters:
generator (str)
device (str)
num_envs (int)
min_num_points (int)
max_num_points (int)
num_points_per_segment (int)
min_point_distance (float)
min_angle (float)
rad (float)
edgy (float)
scale (float)
handle_clamp_frac (float)
hull_displacement (float)
checkpoint_count (int)
checkpoint_radius_min_frac (float)
checkpoint_angle_jitter (float)
checkpoint_turn_rate (float)
checkpoint_steer_gain (float)
checkpoint_lookahead_frac (float)
checkpoint_best_of_k (int)
checkpoint_clip_fallback (bool)
style_sampling (bool)
polar_num_knots (int)
polar_radial_jitter (float)
polar_angular_jitter (float)
voronoi_num_sites (int)
voronoi_site_layout (str)
voronoi_control_points (int)
voronoi_radial_variation (float)
voronoi_angular_jitter (float)
repulsive_grow_mult_min (float)
repulsive_grow_mult_max (float)
repulsive_domain_frac (float)
repulsive_domain_init_ratio (float)
repulsive_obstacle_count_min (int)
repulsive_obstacle_count_max (int)
repulsive_obstacle_radius_min_frac (float)
repulsive_obstacle_radius_max_frac (float)
repulsive_ratchet_rate (float)
repulsive_alpha (float)
repulsive_beta (float)
repulsive_tau (float)
repulsive_w_len (float)
repulsive_settle_iters (int)
repulsive_resample_every (int)
repulsive_stall_window (int)
repulsive_stall_area_tol (float)
repulsive_deactivate_obstacles (bool)
num_harmonics (int)
decay_p (int)
amplitude (float)
num_centerline_samples (int)
half_width (float)
relax_enable (bool)
relax_solver (str)
relax_chunk_size (int | None)
relax_use_warp (bool | None)
relax_tol (float)
relax_band (int | None)
relax_iters (int)
relax_accel (str)
relax_cheby_rho (float)
relax_cheby_gamma (float)
relax_cheby_start (int)
relax_smooth_passes (int)
relax_smooth_spacing_iters (int)
relax_sep_every (int)
relax_sep_cache_slots (int)
relax_sep_cache_skin (float)
relax_sep_relax (float)
relax_spc_relax (float)
relax_bend_relax (float)
relax_margin (float)
energy_steps (int)
energy_lr (float)
energy_w_sep (float)
energy_w_len (float)
energy_w_bend (float)
energy_w_anchor (float)
tp_iters (int)
tp_tau (float)
tp_alpha (float)
tp_beta (float)
smooth_finish (bool)
smooth_finish_iters (int)
smooth_finish_tau (float)
num_points (int)
output_mode (str)
spacing (float | None)
N_max (int)
max_regen_iters (int)
turning_tol (float)
w_floor (float)
validity_border_check (bool)
z_profile (str)
z_base (float)
z_min (float)
z_max (float)
z_max_step (float)
z_noise_amplitude (float)
z_noise_harmonics (int)
z_control_points (int)
z_valid_grade (float)
- Return type:
None
- classmethod __new__(*args, **kwargs)¶
- class GateGenConfig[source]¶
Bases:
objectConfiguration for fixed-batch native gate sequence generation.
Used by
GateGeneratorto produce batchedGateSequenceresults. The gate path only samples corner anchors and emits them directly as gates; it never runs Bezier or hull curve assembly. As a result,num_points_per_segment,rad,edgy,handle_clamp_frac, andhull_displacementare inert for gate output (kept for config parity withTrackGenConfig). The effective knobs for anchor placement aremin_num_points,max_num_points,min_point_distance, andscale.- generator¶
Registered generator name. One of
"bezier"(default),"hull","polar","voronoi", or"checkpoint". Selects the anchor sampling family; only the anchor positions are used as gates.- Type:
- gate_radius¶
Gate detection radius used for gate-constraint solve proximity checks. Must be >= 0.
- Type:
- gate_width¶
Physical gate half-width (visual/collision extent). Must be >= 0. Does not affect anchor sampling geometry.
- Type:
- gate_ordering¶
Gate output ordering. One of
"ccw"(counter-clockwise sort by angle around the batch centroid; default),"raw"(generator order as sampled), or"random_pairs"(random gate pairs for training objectives).- Type:
- min_num_points¶
Minimum corner-anchor count per env for the bezier/hull point sampler. Must be >= 2. Affects the number of sampled anchor positions.
- Type:
- num_points_per_segment¶
Inert for gate output. Dense samples per segment for Bezier/hull curve assembly; the gate path does not assemble curves. Kept for config parity with
TrackGenConfig.- Type:
- min_point_distance¶
Minimum grid-cell spacing for anchor-position sampling. Must be > 0. Governs the cell grid as
num_cells = int(1 / (min_point_distance * 2)).- Type:
- rad¶
Inert for gate output. Bezier handle-length fraction. Kept for config parity with
TrackGenConfig.- Type:
- edgy¶
Inert for gate output. Corner-tangent blend weight. Kept for config parity with
TrackGenConfig.- Type:
- scale¶
Isotropic scale multiplier for anchor positions. Does affect the sampled anchor coordinates and hence gate positions.
- Type:
- handle_clamp_frac¶
Inert for gate output. Bezier handle clamp. Kept for config parity with
TrackGenConfig.- Type:
- hull_displacement¶
Inert for gate output. Hull midpoint displacement fraction. Kept for config parity with
TrackGenConfig.- Type:
- polar_num_knots¶
Polar generator only. Number of periodic cubic-spline control knots. Default 12.
- Type:
- polar_radial_jitter¶
Polar generator only. Radial jitter magnitude for polar control knots, as a fraction of the base radius. Default 0.60.
- Type:
- polar_angular_jitter¶
Polar generator only. Angular jitter per polar knot, as a fraction of a half angular cell. Default 0.30.
- Type:
- voronoi_num_sites¶
Voronoi generator only. Total cell sites in the fixed site field. Must be >=
voronoi_control_points. Default 256.- Type:
- voronoi_site_layout¶
Voronoi generator only. Site distribution layout. One of
"ring","void_ring"(default),"clustered", or"mixed".- Type:
- voronoi_control_points¶
Voronoi generator only. Anchor sites selected from the site field. Must be >= 3 (the gate-native Voronoi path emits anchors directly as gates, so it needs only 3 for a non-degenerate ring — unlike
TrackGenConfig’s >= 6 floor for Chaikin/Catmull-Rom densification).- Type:
- voronoi_radial_variation¶
Voronoi generator only. Radial modulation of anchor target positions. Must be >= 0. Default 0.62.
- Type:
- voronoi_angular_jitter¶
Voronoi generator only. Angular jitter for anchor sector targets. Must be >= 0. Default 0.08.
- Type:
- checkpoint_count¶
Checkpoint generator only. Number of radial checkpoints. Must be >= 3. Default 12.
- Type:
- checkpoint_radius_min_frac¶
Checkpoint generator only. Inner-radius fraction for checkpoint placement. Must be in
[0, 1). Default 0.33.- Type:
- checkpoint_angle_jitter¶
Checkpoint generator only. Angular jitter as a fraction of the per-checkpoint angular slot. Default 0.55.
- Type:
- z_profile¶
Per-gate altitude (Z) profile family. One of
"flat"(default, every real gate atz_base),"uniform"(i.i.d. uniform in[z_min, z_max]),"random_walk"(Brownian-bridge walk clamped to[z_min, z_max]with a per-step grade cap ofz_max_step), or"noise"(periodic harmonic noise aroundz_base). Applied bywarp_zprofile.apply_z_profileafter XY ordering/relaxation and before the 3D lift, wired into the generation pipeline bywarp_gate._run_gate_pipeline.- Type:
- z_base¶
Baseline altitude for the
"flat","random_walk", and"noise"profiles. Default 0.0.- Type:
- z_min¶
Lower altitude clamp for
"uniform","random_walk", and"noise". Must be <=z_max. Default 0.0.- Type:
- z_max¶
Upper altitude clamp for
"uniform","random_walk", and"noise". Must be >=z_min. Default 0.0.- Type:
- z_max_step¶
Random-walk profile only. Maximum
|dz|per unit plan-view arc length (a grade cap), applied per random-walk step before the closure bridge. Must be >= 0. Default 0.0.- Type:
- z_noise_amplitude¶
Noise profile only. Amplitude of the harmonic altitude oscillation around
z_base. Must be >= 0. Default 0.0.- Type:
- z_noise_harmonics¶
Noise profile only. Number of summed harmonics in the periodic noise field. Must be >= 1. Default 3.
- Type:
- z_valid_grade¶
Maximum allowed
|dz|/ds grade for post-hoc course validity checking. 0 disables the check. Must be >= 0. Default 0.0. (Consumed starting in Task 4; unused bywarp_zprofileitself.)- Type:
- gate_align¶
Gate-frame alignment mode.
"yaw_only"(default) keeps gate posts horizontal (the frame forward axis is the plan-view tangent projected onto the XY plane, so left/right posts share the center’s altitude);"full_tangent"aligns the frame forward axis with the full 3D tangent, tilting posts to follow the course slope.- Type:
- __init__(generator='bezier', device='cpu', num_envs=1, min_gates=4, max_gates=32, gate_radius=0.025, gate_solve_iters=8, gate_width=0.0, gate_ordering='ccw', min_num_points=9, max_num_points=13, num_points_per_segment=30, min_point_distance=0.05, rad=0.4, edgy=0.0, scale=1.0, handle_clamp_frac=0.4, hull_displacement=0.15, polar_num_knots=12, polar_radial_jitter=0.6, polar_angular_jitter=0.3, voronoi_num_sites=256, voronoi_site_layout='void_ring', voronoi_control_points=18, voronoi_radial_variation=0.62, voronoi_angular_jitter=0.08, checkpoint_count=12, checkpoint_radius_min_frac=0.33, checkpoint_angle_jitter=0.55, z_profile='flat', z_base=0.0, z_min=0.0, z_max=0.0, z_max_step=0.0, z_noise_amplitude=0.0, z_noise_harmonics=3, z_valid_grade=0.0, gate_align='yaw_only')¶
- Parameters:
generator (str)
device (str)
num_envs (int)
min_gates (int)
max_gates (int)
gate_radius (float)
gate_solve_iters (int)
gate_width (float)
gate_ordering (str)
min_num_points (int)
max_num_points (int)
num_points_per_segment (int)
min_point_distance (float)
rad (float)
edgy (float)
scale (float)
handle_clamp_frac (float)
hull_displacement (float)
polar_num_knots (int)
polar_radial_jitter (float)
polar_angular_jitter (float)
voronoi_num_sites (int)
voronoi_site_layout (str)
voronoi_control_points (int)
voronoi_radial_variation (float)
voronoi_angular_jitter (float)
checkpoint_count (int)
checkpoint_radius_min_frac (float)
checkpoint_angle_jitter (float)
z_profile (str)
z_base (float)
z_min (float)
z_max (float)
z_max_step (float)
z_noise_amplitude (float)
z_noise_harmonics (int)
z_valid_grade (float)
gate_align (str)
- Return type:
None
- classmethod __new__(*args, **kwargs)¶