pub fn finalize_step_amf(
ws: &mut Workspace,
me: usize,
pme1: usize,
pme2_excl: usize,
nvpiv: i32,
degme: usize,
elenme: i32,
aggressive: bool,
) -> StepFlopsExpand description
AMF analogue of finalize_step. The Pass-1 element seeding,
hash-bucket detection, and supervariable-merge structure mirror
AMD; the per-iteration accumulator carries the AMF triple
(deg, wf3, wf4) (Amestoy 1999 thesis), and the re-insertion
computes the quantized RMF score and inserts at
head[amf_bucket_of(wf[i], n)].
Six metric-specific sites compared to AMD (numbered per
dev/research/amf-clean-room.md Section 6):
- Pass-1 also resets
wf[e] = 0on the first touch of each element (lazy cache sentinel). - Pass-2 element walk caches
wf[e] = dext * (2*deg(e) - dext - 1)on first encounter and accumulateswf4 += wf[e]. - Pass-2 variable walk accumulates
wf3 += nv[j]. - Loose-degree special case zeroes
wf3 = wf4 = 0; the keptdegree[i]cannot have a meaningful WF-subtraction so the AMF score is reset. - Supervariable merge takes
wf[i] = max(wf[i], wf[j]). - Re-insertion uses the saturated/regular RMF formula with
dummy = i32::MAX - 1, quantizes viabucket(wf[i], n), and threads throughheadof length2 * n + 2.
Reference: ana_orderings.F:4660-5025.