stt: no test case exercises `makeSteinerTree`'s alpha branch or its FLUTE fallback

Aperta
#11,460 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp, python
Ambito
testing-qa

Direzione di ricerca

Start at SteinerTreeBuilder::makeSteinerTree and the existing cases under src/stt/test, especially check.tcl and report_stt_net. Review src/stt/test/BUILD and CMakeLists.txt for the two test entry points, then run //src/stt/test:stt_gate-tcl_test and //src/stt/test:stt_gate-py_test. Done means the stt_gate inputs and expected output cover the listed branches and both build-system tests pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

stt

SteinerTreeBuilder::makeSteinerTree is the public entry point for Steiner tree construction, and
it is where the choice between the two builders is made:

if (alpha > 0.0) {
  Tree tree = pdr::primDijkstra(x, y, drvr_index, alpha, logger_);
  if (checkTree(tree)) { return tree; }
  // Fall back to flute if PD fails.
}
return flute_->flute(x, y, kFluteAccuracy);

Reading src/stt/test, the cases reach the builders directly rather than through this function:

case helper reaches
flute1, flute_gcd report_flute_net Flute::flute
pd1, pd2, pd_gcd report_pd_net pdr::primDijkstra
check report_stt_net makeSteinerTree — one net, one alpha
parse_clocks — filter_clk_nets, no trees

check.tcl is the only case that calls it, with a single 11-pin net at alpha 0.3. So the
alpha > 0.0 comparison has a witness on one side only, checkTree is never observed rejecting
anything, and the FLUTE fallback after a failed check has no witness at all. Inverting the
comparison, inverting the check, or returning the rejected tree instead of rebuilding would leave
all seven cases passing.

The fallback is reachable in practice, not just in principle: over randomly generated nets, on the
order of one in thirty thousand produces a Prim-Dijkstra tree that checkTree rejects.

Two smaller gaps in the same area, from the shipped inputs:

  • gcd.nets (which drives flute_gcd and pd_gcd) has top-level degrees 3–8, 10, 11 and 36;
    flute1 is one 250-pin net; pd1, pd2 and check are small. No case has a top-level net of
    degree 2 or degree 9.
    Degree 9 is kMaxLutDegree, and kNumGroup[9] is about 89% of the
    groups in the lookup table. Degree 2 is a separate early return in both Flute::flute and
    Flute::flutes_low_degree, and the two index differently.
    ⚠️ Both degrees are reachable by recursion from larger nets, so this is a gap in direct
    coverage rather than a claim that the code never runs.

  • report_stt_net on a one-pin net at alpha 0 aborts:

    [ERROR STT-0007] Invalid driver index -1.
    

    Flute::flute returns deg = 1 with an empty branch vector, so findLocationIndex scans
    nothing and returns -1. primDijkstra has no such problem — pd1's one net reports fine.
    Whether that matters outside the reporter is a real question: grt consumes the Tree rather
    than printing it, and an empty branch on a one-pin net may be exactly what it wants.

What we could offer

A single case, stt_gate, in the shape of the existing ones: stt_gate.tcl, stt_gate.py and a
shared stt_gate.ok, plus one line in src/stt/test/BUILD and one in CMakeLists.txt. It drives
41 nets through report_stt_net and reaches:

  • every lookup-table degree 4–9 and the degenerate returns below 4, including 2 and 9;
  • the medium-degree decomposition, its scoring heuristic and all three merges;
  • alpha = 0 and alpha > 0 over the same points, so the branch is crossed both ways;
  • a driver index that is not 0, and duplicate pin locations;
  • a net whose Prim-Dijkstra tree fails checkTree, so the fallback executes;
  • a 120-pin net, above the deg > 100 bound where checkTree is skipped.

It runs under both build systems today — //src/stt/test:stt_gate-tcl_test and
//src/stt/test:stt_gate-py_test both pass locally against an unmodified build.

⚠️ The .ok would be generated at a specific commit rather than at master; happy to regenerate it
against whatever you would merge.

Questions
  1. Would you want this as a PR? Nothing is opened until you say so.
  2. Is one broad case welcome in src/stt/test, or would you rather have it split per behaviour?
    Either shape is easy on our side.
  3. Is the FLUTE fallback meant to be reachable at all, or is a checkTree rejection a sign of
    something upstream of it worth fixing?
Lingua principale
Verilog
Stelle
3.4k
Fork
1.1k
Merge medio
3g 11h
PR unite (30g)
245

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di The-OpenROAD-Project/OpenROAD

Tutte le issue di The-OpenROAD-Project/OpenROAD

Issue simili

Altre issue su Testing & QA

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.