#import "../../template/utils/diagram.typ": flex-caption
#import "../../../shared/figure_identity.typ": gallery_visual
#import "../../../shared/macros.typ": *
#import "../../../shared/symbols.typ": symb
#import "../../../shared/equations.typ": eqs
#import "../../../shared/tables.typ": publication-table
#import "../../draft_markers.typ": todo, conflict_todo, validation_todo, decision_todo, question_todo, review_note, review_strike


== Applied sampler construction <ssec:repro-candidate-sampling>

Each row of the three local families begins with a random unit direction in the gravity-aligned sampling
frame #symb.frame.s, whose origin is the reference rig position and whose
forward axis follows its horizontal heading. The
frozen profile uses a forward-biased Power Spherical distribution with
$kappa=8$ @PowerSpherical-deCao2020:

$
  #eqs.action.power_spherical_forward
$

The sampled direction is then mapped into the configured azimuth and elevation
caps. With $psi = op("atan2")(u_x, u_z)$ and $u_y = sin theta$, the transform is

$
  #eqs.action.angle_cap_transform
$

$
  #eqs.action.capped_direction
$

@fig:candidate-sampling-distribution follows the same draws through both
transformations. The angular bounds constrain the intermediate directions;
the family map determines the final directional support.

#figure(
 image("/figures/thesis/vector/03-oracle-and-data-generation/03-02-target-task-and-rri-labels/candidate-generation/candidate_sampling_distribution.pdf",width:100%),
 alt: "The same directions before angular remapping, after remapping, and after forward-local shaping, with equal-solid-angle-bin frequencies.",
 caption: flex-caption([From Power Spherical sampling to forward-local proposals. The 600
 seeded draws use the actual position sampler. Spherical panels show direction;
 lower panels show empirical frequency in equal-solid-angle bins on a common
 logarithmic scale, floored at $10^(-3)$. Radius is sampled subsequently.], [Applied directional sampling.]),
) <fig:candidate-sampling-distribution>

The cap deterministically remaps every draw and therefore changes angular
support without changing the row count. This is not rejection sampling from
the original distribution conditioned on the configured caps. Family-specific
maps then reinterpret the same bounded random variable relative to rig forward,
the target bearing, or the lateral direction. This factorization separates
*diversity within a family* from *the geometric meaning of the family*.

Let $bold(f)=bold(e)_z$ denote sampling-frame forward, $bold(b)_e$ the supplied target
bearing, $bold(l)_e$ its normalized horizontal lateral direction, and
$bold(e)_y$ world up in the sampling frame. #review_note(kind: "keep", id: "AW20-25", position: auto,
  note: [Keep the geometric interpretation of transverse perturbations, bypass sides, and normalization aligned with the family equations and plotted proposals.],
  source: [Rendered-content follow-up, 2026-09-20; 03-02-target-task-and-rri-labels.typ],
  gate: [Advisory: the surrounding explanation supports the stated reader takeaway.],
)[The three core maps are]

$
  #eqs.action.family_directions
$

The forward and target maps remove the component parallel to their main
direction, then scale the remaining transverse perturbation around that
direction. The bypass sign chooses a lateral side; clipping limits its vertical
perturbation, and normalization gives a unit direction before radius selection.

A family-conditioned radius turns direction into translation; the reference
sampling pose then maps that offset into world coordinates:

$
  #eqs.action.candidate_center_world
$

// End of retained detail.




=== Target population and sampling priority <ssec:thesis-target-sampling>

A confidently detected cabinet can still have an unobserved side. Low
confidence, by contrast, may reflect an ambiguous object estimate rather than
a need for further reconstruction. Detection reliability and
reconstruction need are different quantities. Admission determines which
objects belong to the study; sampling determines how often those objects
contribute training examples. The value model then predicts the benefit of a
view for the specified object. Goal-conditioned value functions make this last
relationship explicit by conditioning on the supplied goal @UVFA-schaul2015.

// evidence:
// - @UVFA-schaul2015 -> https://proceedings.mlr.press/v37/schaul15.html, Sec. 2 (value conditioned on state and goal; no optimal target-task sampling claim).

For a nonempty ground-truth pool, selecting $k=min(K, N)$ of $N$ eligible targets
with cap $K$ gives each target inclusion probability $k/N$. #review_note(
  kind: "keep", id: "D13", position: left,
  note: [Keep this small probability example. It explains the implemented sampler; the proposed weighted-sampling tutorial below need not become another prerequisite.],
)[For example,
selecting three of ten targets gives each a $3/10$ chance of appearing in the
sample, although its chance of being drawn first is only $1/10$.] This is the
difference between *inclusion probability* and *draw probability*. Here $N$
counts geometry-valid reference objects for the legacy control and
support-eligible objects for the applied development collection. The same
uniform-subset rule applies after either population has been defined.

*Implementation correspondence.* The sampler implements the subset through a
random permutation and stores the marginal inclusion probability in
`selection_probability`. The current-root support receipt retains the
pre-sampling population and its exclusions.

The observed route includes every uniquely matched descriptor at task
construction. Subsequent execution limits and failures are recorded separately:
being selected for generation is not the same as producing a usable rollout.
Neither construction gives uniform exposure to unique objects or scenes,
because an object can recur in overlapping snippets. Evaluation must therefore
specify its scene, root-context, and target populations. Eligibility is fixed
before gains are measured, and the target identity and root normalization stay
fixed during each rollout.

The implemented sampler uses the uniform rule above. Weighted target exposure
is an unselected alternative discussed in the development alternatives register;
its sampling weights would require a separate inclusion-probability definition.

Confidence can indicate detection reliability, subject to calibration; the
current detector’s calibration remains unestablished. Image area and observed
surface coverage describe acquired support. None directly measures remaining
reconstruction need. Ground-truth IoU can support offline association or
sampling diagnostics, but cannot enter an observation-only selection rule.
The detailed calibration and optional allocation alternatives are retained in
the development register; the implemented admission is specified in
@ssec:thesis-observed-target-admission.

=== Sibling-heading guard <ssec:repro-sibling-heading>

Sibling
diversity uses the camera-forward direction projected onto the world $x y$
plane, with world $+z$ as up. A nearly vertical view has no stable horizontal
heading: it may be retained as the first sibling, but cannot support further
heading-constrained branches. Stochastic fallback may relax angular separation,
but does not waive heading availability; fewer siblings than requested may
therefore be retained when the yaw guard is enabled.

Normalization uses the original finite score vector; the sampling probabilities
are recomputed over the remaining eligible rows after each draw.
