<pre>
$ ../crushtool -c cli/crushtool/set-choose.crushmap.txt -o set-choose.crushmap ; ../crushtool -i set-choose.crushmap --show-bad-mappings --test --rule 0 --x 1 --num-rep 4
CHOOSE bucket -5 x 1 outpos 0 numrep 4
 crush_bucket_choose -5 x=1 r=0
  item -4 type 2
 crush_bucket_choose -4 x=1 r=0
  item -1 type 1
CHOOSE got -1
 crush_bucket_choose -5 x=1 r=1
  item -4 type 2
 crush_bucket_choose -4 x=1 r=1
  item -3 type 1
CHOOSE got -3
 crush_bucket_choose -5 x=1 r=2
  item -4 type 2
 crush_bucket_choose -4 x=1 r=2
  item -1 type 1
  reject 0  collide 1  ftotal 1  flocal 1
 crush_bucket_choose -4 x=1 r=3
  item -2 type 1
CHOOSE got -2
 crush_bucket_choose -5 x=1 r=3
  item -4 type 2
 crush_bucket_choose -4 x=1 r=3
  item -2 type 1
  reject 0  collide 1  ftotal 1  flocal 1
 crush_bucket_choose -4 x=1 r=4
  item -1 type 1
  reject 0  collide 1  ftotal 2  flocal 2
 crush_bucket_choose -4 x=1 r=5
  item -2 type 1
  reject 0  collide 1  ftotal 3  flocal 3
bucket -4 new x=1
 perm_choose -4 sz=3 x=1 r=6 (0) s=0
  item -1 type 1
  reject 0  collide 1  ftotal 4  flocal 4
 perm_choose have 0: 0
 perm_choose swap 1 with 1
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=7 (1) s=1
  item -2 type 1
  reject 0  collide 1  ftotal 5  flocal 5
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=8 (2) s=2
  item -3 type 1
  reject 0  collide 1  ftotal 6  flocal 6
 crush_bucket_choose -5 x=1 r=9
  item -4 type 2
 crush_bucket_choose -4 x=1 r=9
  item -2 type 1
  reject 0  collide 1  ftotal 7  flocal 1
 crush_bucket_choose -4 x=1 r=10
  item -3 type 1
  reject 0  collide 1  ftotal 8  flocal 2
 crush_bucket_choose -4 x=1 r=11
  item -2 type 1
  reject 0  collide 1  ftotal 9  flocal 3
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose have 2: 2
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=12 (0) s=0
  item -1 type 1
  reject 0  collide 1  ftotal 10  flocal 4
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose have 2: 2
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=13 (1) s=1
  item -2 type 1
  reject 0  collide 1  ftotal 11  flocal 5
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose have 2: 2
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=14 (2) s=2
  item -3 type 1
  reject 0  collide 1  ftotal 12  flocal 6
 crush_bucket_choose -5 x=1 r=15
  item -4 type 2
 crush_bucket_choose -4 x=1 r=15
  item -3 type 1
  reject 0  collide 1  ftotal 13  flocal 1
 crush_bucket_choose -4 x=1 r=16
  item -1 type 1
  reject 0  collide 1  ftotal 14  flocal 2
 crush_bucket_choose -4 x=1 r=17
  item -2 type 1
  reject 0  collide 1  ftotal 15  flocal 3
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose have 2: 2
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=18 (0) s=0
  item -1 type 1
  reject 0  collide 1  ftotal 16  flocal 4
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose have 2: 2
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=19 (1) s=1
  item -2 type 1
  reject 0  collide 1  ftotal 17  flocal 5
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose have 2: 2
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=20 (2) s=2
  item -3 type 1
  reject 0  collide 1  ftotal 18  flocal 6
 crush_bucket_choose -5 x=1 r=21
  item -4 type 2
 crush_bucket_choose -4 x=1 r=21
  item -2 type 1
  reject 0  collide 1  ftotal 19  flocal 1
 crush_bucket_choose -4 x=1 r=22
  item -3 type 1
  reject 0  collide 1  ftotal 20  flocal 2
 crush_bucket_choose -4 x=1 r=23
  item -3 type 1
  reject 0  collide 1  ftotal 21  flocal 3
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose have 2: 2
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=24 (0) s=0
  item -1 type 1
  reject 0  collide 1  ftotal 22  flocal 4
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose have 2: 2
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=25 (1) s=1
  item -2 type 1
  reject 0  collide 1  ftotal 23  flocal 5
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose have 2: 2
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=26 (2) s=2
  item -3 type 1
  reject 0  collide 1  ftotal 24  flocal 6
 crush_bucket_choose -5 x=1 r=27
  item -4 type 2
 crush_bucket_choose -4 x=1 r=27
  item -1 type 1
  reject 0  collide 1  ftotal 25  flocal 1
 crush_bucket_choose -4 x=1 r=28
  item -3 type 1
  reject 0  collide 1  ftotal 26  flocal 2
 crush_bucket_choose -4 x=1 r=29
  item -3 type 1
  reject 0  collide 1  ftotal 27  flocal 3
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose have 2: 2
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=30 (0) s=0
  item -1 type 1
  reject 0  collide 1  ftotal 28  flocal 4
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose have 2: 2
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=31 (1) s=1
  item -2 type 1
  reject 0  collide 1  ftotal 29  flocal 5
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose have 2: 2
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=32 (2) s=2
  item -3 type 1
  reject 0  collide 1  ftotal 30  flocal 6
 crush_bucket_choose -5 x=1 r=33
  item -4 type 2
 crush_bucket_choose -4 x=1 r=33
  item -3 type 1
  reject 0  collide 1  ftotal 31  flocal 1
 crush_bucket_choose -4 x=1 r=34
  item -1 type 1
  reject 0  collide 1  ftotal 32  flocal 2
 crush_bucket_choose -4 x=1 r=35
  item -2 type 1
  reject 0  collide 1  ftotal 33  flocal 3
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose have 2: 2
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=36 (0) s=0
  item -1 type 1
  reject 0  collide 1  ftotal 34  flocal 4
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose have 2: 2
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=37 (1) s=1
  item -2 type 1
  reject 0  collide 1  ftotal 35  flocal 5
 perm_choose have 0: 0
 perm_choose have 1: 1
 perm_choose have 2: 2
 perm_choose  0: 0
 perm_choose  1: 1
 perm_choose  2: 2
 perm_choose -4 sz=3 x=1 r=38 (2) s=2
  item -3 type 1
  reject 0  collide 1  ftotal 36  flocal 6
skip rep
CHOOSE returns 3
CHOOSE bucket -1 x 1 outpos 0 numrep 1
 crush_bucket_choose -1 x=1 r=0
  item 0 type 0
CHOOSE got 0
CHOOSE returns 1
CHOOSE bucket -3 x 1 outpos 0 numrep 1
 crush_bucket_choose -3 x=1 r=0
  item 8 type 0
CHOOSE got 8
CHOOSE returns 1
CHOOSE bucket -2 x 1 outpos 0 numrep 1
 crush_bucket_choose -2 x=1 r=0
  item 5 type 0
CHOOSE got 5
CHOOSE returns 1
bad mapping rule 0 x 1 num_rep 4 result [0,8,5]
</pre>