-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
concurrency detection bug #645
Comments
Fix is implemented. 3 new lines of code, not counting a comment and one that's just a |
checklist
|
stats CSVs#diff size for each file not including final TOTAL row
files=$( \
for f in $(tail -n +3 d4a3_conc.l0g | head -n 34 \
| sed -r -e "s~$e\[[0-9]+m~~" -e 's~.*_d4a3/stats/(.+) and .*~\1~'); do
printf "%02i $f\n" $(diff <(head -n -1 _d4a3/stats/$f) <(head -n -1 _conc/stats/$f) | wc -l);
done)
#get deltas from the last lines of those without diffs, formatted to paste into the smbr spreadsheet tab
for f in $(echo "$files" | grep ^00 | cut -f2 -d' '); do
# get column numbers
cols=$(diff <(tail -n 1 _d4a3/stats/$f | sed -e 's~,~\n\n~g' -e 's~TOTAL~\n0~') \
<(tail -n 1 _conc/stats/$f | sed -e 's~,~\n\n~g' -e 's~TOTAL~\n0~') \
| egrep '([0-9]+)c\1' | sed -r 's~([0-9]+)c\1~\1/2~' | bc | tail -n +2) # skip trav total column
for col in $cols; do
rg=`head -n 1 _d4a3/stats/$f | cut -f$col -d,`
d=`paste -d- <(tail -n 1 _d4a3/stats/$f | cut -f$col -d,) \
<(tail -n 1 _conc/stats/$f | cut -f$col -d,) | bc`
echo $f | sed "s~-all.csv~\t$rg\t$d~"
done
done
#do those with traveler diffs
for f in $(echo "$files" | grep -v ^00 | cut -f2 -d' '); do
#get row numbers
rows=$(diff _d4a3/stats/$f _conc/stats/$f \
| egrep '([0-9]+,[0-9]+)c\1|([0-9]+)c\2' \
| sed -e 's~c.*~~' -e 's~,~ ~')
for row in $rows; do
l1=`tail -n +$row _d4a3/stats/$f | head -n 1`
l2=`tail -n +$row _conc/stats/$f | head -n 1`
t=`echo $l1 | cut -f1 -d,`
# get column numbers
cols=$(diff <(echo; echo $l1 | sed -e 's~,~\n\n~g') \
<(echo; echo $l2 | sed -e 's~,~\n\n~g') \
| egrep '([0-9]+)c\1' | sed -r 's~([0-9]+)c\1~\1/2~' | bc)
for col in $cols; do
rg=`head -n 1 _d4a3/stats/$f | cut -f$col -d,`
d=`paste -d- <(echo $l1 | cut -f$col -d,) <(echo $l2 | cut -f$col -d,) | bc`
echo $f | sed "s~[-.].*~\t$rg\t$t\t$d~"
done
done
done grep & compare...
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
LOL clinched table#find new concurrencies in concurrencies.log & & search for augments based on them
cl=$( \
fgrep -f \
<(diff <(grep -v augment _d4a3/logs/concurrencies.log) \
<(grep -v augment _conc/logs/concurrencies.log) \
| grep '^>' | sed -r 's~^> New concurrency (\[.+\])(\[.+\]) \(2\)$~\1 based on \2\n\2 based on \1~') \
_conc/logs/concurrencies.log \
| sed -r 's~Concurrency augment for traveler (.+) based on .+~\1~')
#convert DB lines to the same style
db=$( \
for e in $(diff <(tail -n +354277 _d4a3/TravelMapping.sql | head -n 212997 | sed s/^,// | sort) \
<(tail -n +354277 _conc/TravelMapping.sql | head -n 213005 | sed s/^,// | sort) \
| grep '^>' | cut -f2 -d" "); do
t=`echo "$e" | cut -f4 -d"'"`
id=`echo "$e" | cut -f2 -d"'"`
s_line=`tail -n +186429 _d4a3/TravelMapping.sql | head -n 167848 | egrep "^,?\('$id'"`
r=`echo "$s_line" | cut -f8 -d"'"`
r=`tail -n +1494 _d4a3/TravelMapping.sql | head -n 5695 | grep "$r'"`
r=`(echo "$r" | cut -f4 -d"'"; echo "$r" | cut -f6 -d"'") | tr '\n' ' '`
i=`echo "$s_line" | cut -f4 -d"'"`
w_pair=`tail -n +12887 _d4a3/TravelMapping.sql | head -n 173542 | grep -A 1 "^,\?('$i'" | tr -d '\n'`
w=`echo "$w_pair" | cut -f4 -d"'"`
p=`echo "$w_pair" | cut -f14 -d"'"`
echo "$t: [$r$w $p]"
done)
#now sort & diff them
diff <(echo "$cl" | sort) <(echo "$db" | sort) |
graphs=$(diff -qr _d4a3/graphs/ _conc/graphs/ | cut -f3 -d/ | sed -e 's~\.tmg.*~~' -e 's~-simple$\|-traveled$~~' | uniq)
allgraphs=$(diff -qr _d4a3/graphs/ _conc/graphs/ | cut -f3 -d/ | sed -e 's~\.tmg.*~~') Simple graphs
|
Collapsed graph verticesNumber of vertices differ in some collapsed graphs. Makes sense though. e=`echo -en '\e'`
for g in $graphs; do
oldv=`head -n 2 _d4a3/graphs/$g.tmg | tail -n 1 | cut -f1 -d' '`
newv=`head -n 2 _conc/graphs/$g.tmg | tail -n 1 | cut -f1 -d' '`
d=`diff <(tail -n +3 _d4a3/graphs/$g.tmg | head -n $oldv) \
<(tail -n +3 _conc/graphs/$g.tmg | head -n $newv) | grep '^[<>]'`
if [ `echo "$d" | wc -w` -gt 0 ]; then echo -e "$g\n$d"; fi
done \
| sed -e "s~^<.*~$e[31m&$e[0m~" \
-e "s~^>.*~$e[32m&$e[0m~" Each line item diff falls into 1 of 2 categories:
|
This comment was marked as outdated.
This comment was marked as outdated.
Collapsed graph edgesLooking at the diffs between graph edges shows that diffs don't just occur one-by-one. They come in clusters, in one of three patterns. These patterns can be mixed & matched in a graph, and occur however many times.
|
Traveled graphsIf collapsed graphs make sense, traveled graphs will be fine too. trav=$( \
for g in $graphs; do \
d=$(diff <(tail -n +2 _conc/graphs/$g.tmg | head -n 1) \
<(tail -n +2 _conc/graphs/$g-traveled.tmg | head -n 1 | sed -r 's~(.+ .+) .*~\1~') \
| grep '^[<>]')
if [ `echo "$d" | wc -w` -gt 0 ]; then echo "$g"; fi; done)
e=`echo -en '\e'`
for g in $trav; do
cv=$(tail -n +2 _conc/graphs/$g.tmg | head -n 1 | cut -f1 -d' ')
tv=$(tail -n +2 _conc/graphs/$g-traveled.tmg | head -n 1 | cut -f1 -d' ')
echo "$e[1m$g$e[0m"
d=$(diff <(tail -n +3 _conc/graphs/$g.tmg | head -n $cv) \
<(tail -n +3 _conc/graphs/$g-traveled.tmg | head -n $tv) | grep '^[<>]')
for l in $(echo "$d" | tr ' ' '%'); do
echo "$l" | tr '%' ' '
fgrep -ir -f <(echo "$l" | cut -f2 -d@ | cut -f1 -d% | sed 's~^+~~') ~/tm/UserData/rlist_files
done
done ...gives strong (though not foolproof) evidence that all uncollapsed vertices are used in .lists.
|
Uncovered some concurrency problem while trying to expand the HIDDEN_JUNCTION datacheck to catch cases that'd produce a segment name mismatch error (#91, #178, #603) in datacheck mode before making it to the graph generation process.
eeea42f
):ME DE +DIV_Por1 Por
is not flagged as concurrent withME DE Por +DIV_Por2
.PA US19TrkPit I-376(69B)_S I-376(69A)
is concurrent withPA US19TrkPit I-376(69A) I-376(69B)_N
as expected (7a955f2
).The fact that the DIV points are hidden does not affect this.
The first thing that comes to mind is that ME DE is not concurrent with any other route, whereas PA US19TrkPit has 4 others in the mix. IIRC this fact caused wacky hijinks in my first epic concurrency debugathon back in 2018. OK yeah, that's it. Thank God, I didn't wanna do another one.
DataProcessing/siteupdate/cplusplus/tasks/concurrency_detection.cpp
Line 11 in e280bd5
In this case
p[1]
is not colocated. It's a single point on a single route that's doing a 180° turn.Something like this would be overkill & less efficient; I should be able to move an
if
and bung in anelse
block.The text was updated successfully, but these errors were encountered: