Skip to content

Commit 7d6d89c

Browse files
committed
swap: add warning and link to #12 (reordering bug)
1 parent 9c963a7 commit 7d6d89c

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/swap.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,9 @@ impl XVHLScaffold {
572572
// (var, ix) pairs, where plan is to lift var to row ix
573573
let plan = self.plan_regroup(&groups);
574574
if plan.is_empty() { return }
575+
// println!("current order: {:?}", self.vids);
576+
// println!("goal grouping: {:?}", groups);
577+
// println!("regroup plan: {:?}", plan);
575578
let mut swarm: Swarm<Q,R,SwapWorker> = Swarm::new_with_threads(plan.len());
576579
let mut alarm: HashMap<VID,WID> = HashMap::new();
577580
let _:Option<()> = swarm.run(|wid,qid,r|->SwarmCmd<Q,()> {
@@ -616,9 +619,17 @@ impl XVHLScaffold {
616619

617620
QID::DONE => { SwarmCmd::Pass }}});
618621

619-
let plan2 = self.plan_regroup(&groups);
620-
debug_assert!(plan2.is_empty(), "regroup failed to make these moves: {:?}", plan2);
621622
debug_assert!(self.locked.is_empty());
623+
// println!("variables now: {:?}", self.vids);
624+
let plan2 = self.plan_regroup(&groups);
625+
// println!("remaining regroup plan: {:?}", plan2);
626+
if !plan2.is_empty() {
627+
println!("------------------------------------------------");
628+
println!("WARNING! reordering operation did not complete!");
629+
println!("Regroup failed to make these moves: {:?}", plan2);
630+
println!("------------------------------------------------");
631+
println!("This is a known bug. See here for status and workarounds:");
632+
println!("https://github.com/tangentstorm/bex/issues/12"); }
622633
self.validate("after regroup()"); }
623634

624635

0 commit comments

Comments
 (0)