Fixed explicit trunks messing with canonical checksums
Updating the canonical checksum should only depend on if the tag is a
trunkish tag (not a checksum tag), and not if the tag is in the current
trunk. The trunk parameter to lfsr_rbyd_fetch should have no effect on
the canonical checksum.
Fixed in boath lfsr_rbyd_fetch and scripts.
Curiously no code changes:
code stack
before: 36416 2616
after: 36416 (+0.0%) 2616 (+0.0%
This commit is contained in:
+29
-27
@@ -577,12 +577,13 @@ def dbg_log(data, block_size, rev, eoff, weight, *,
|
||||
|
||||
# end of trunk?
|
||||
if not tag & TAG_ALT:
|
||||
# update canonical checksum, xoring out any perturb state
|
||||
cksum = cksum_ ^ (0xfca42daf if perturb else 0)
|
||||
# derive the current tag's rid from alt weights
|
||||
rid = lower_ + w-1
|
||||
trunk_ = 0
|
||||
|
||||
# update canonical checksum, xoring out any perturb state
|
||||
cksum = cksum_ ^ (0xfca42daf if perturb else 0)
|
||||
|
||||
# show human-readable tag representation
|
||||
print('%s%08x:%s %*s%s%*s %-*s%s%s%s' % (
|
||||
'\x1b[90m' if color and j >= eoff else '',
|
||||
@@ -976,33 +977,34 @@ def main(disk, blocks=None, *,
|
||||
cksum__ = cksum_ ^ (0xfca42daf if perturb else 0)
|
||||
|
||||
# evaluate trunks
|
||||
if (tag & 0xf000) != TAG_CKSUM and (
|
||||
not trunk or j_-d <= trunk or trunk___):
|
||||
# new trunk?
|
||||
if not trunk___:
|
||||
trunk___ = j_-d
|
||||
weight__ = 0
|
||||
if (tag & 0xf000) != TAG_CKSUM:
|
||||
if not (trunk and j_-d > trunk and not trunk___):
|
||||
# new trunk?
|
||||
if not trunk___:
|
||||
trunk___ = j_-d
|
||||
weight__ = 0
|
||||
|
||||
# keep track of weight
|
||||
weight__ += w
|
||||
# keep track of weight
|
||||
weight__ += w
|
||||
|
||||
# end of trunk?
|
||||
if not tag & TAG_ALT:
|
||||
# update canonical checksum, xoring out any perturb state
|
||||
cksum_ = cksum__ ^ (0xfca42daf if perturb else 0)
|
||||
# update trunk/weight unless we found a shrub or an
|
||||
# explicit trunk (which may be a shrub) is requested
|
||||
if not tag & TAG_SHRUB or trunk___ == trunk:
|
||||
trunk__ = trunk___
|
||||
weight_ = weight__
|
||||
# keep track of eoff for best matching trunk
|
||||
if trunk and j_ + size > trunk:
|
||||
eoff_ = j_ + size
|
||||
eoff = eoff_
|
||||
cksum = cksum_
|
||||
trunk_ = trunk__
|
||||
weight = weight_
|
||||
trunk___ = 0
|
||||
# end of trunk?
|
||||
if not tag & TAG_ALT:
|
||||
# update trunk/weight unless we found a shrub or an
|
||||
# explicit trunk (which may be a shrub) is requested
|
||||
if not tag & TAG_SHRUB or trunk___ == trunk:
|
||||
trunk__ = trunk___
|
||||
weight_ = weight__
|
||||
# keep track of eoff for best matching trunk
|
||||
if trunk and j_ + size > trunk:
|
||||
eoff_ = j_ + size
|
||||
eoff = eoff_
|
||||
cksum = cksum_
|
||||
trunk_ = trunk__
|
||||
weight = weight_
|
||||
trunk___ = 0
|
||||
|
||||
# update canonical checksum, xoring out any perturb state
|
||||
cksum_ = cksum__ ^ (0xfca42daf if perturb else 0)
|
||||
|
||||
if not tag & TAG_ALT:
|
||||
j_ += size
|
||||
|
||||
Reference in New Issue
Block a user