RB: bind a .tcb capture to the save it was taken on
Replaying a turn's commands against a different board charges the counter happily and produces a confidently wrong number, because the blocks name player ids that exist in both. The converter now records the input save and sots_turn warns when they disagree.
This commit is contained in:
parent
a4a1d373f1
commit
7a41246450
4 changed files with 1370 additions and 2 deletions
|
|
@ -163,9 +163,10 @@ def element_fields(listno, words):
|
|||
return out
|
||||
|
||||
|
||||
def emit(batch, seq, source, names, seeds):
|
||||
def emit(batch, seq, source, names, seeds, input_name):
|
||||
lines = ["tcb 1",
|
||||
"meta source %s" % source,
|
||||
"meta input %s" % input_name,
|
||||
"meta batch seq=%d n=%d" % (seq, batch["n"]),
|
||||
"meta note the load-time batch is excluded; this is the End-Turn submission"]
|
||||
for netid, value in seeds:
|
||||
|
|
@ -206,6 +207,10 @@ def main(argv=None):
|
|||
ap.add_argument("log")
|
||||
ap.add_argument("-o", "--out")
|
||||
ap.add_argument("--batch", type=int, help="which seq to convert (default: the last)")
|
||||
ap.add_argument("--input", default="", metavar="SAVE",
|
||||
help="the save this turn was run FROM. A capture belongs to one board and "
|
||||
"replaying it against another charges the counter happily and is wrong; "
|
||||
"recording it here lets the replayer say so.")
|
||||
ap.add_argument("--name", action="append", default=[], metavar="PID=TECHNAME",
|
||||
help="the tech name a research-target gate was observed to resolve to")
|
||||
ap.add_argument("--seed", action="append", default=[], metavar="NETID=VALUE",
|
||||
|
|
@ -236,7 +241,7 @@ def main(argv=None):
|
|||
return 2
|
||||
seeds.append((netid, value))
|
||||
|
||||
text = emit(batches[seq], seq, a.log.split("/")[-1], names, seeds)
|
||||
text = emit(batches[seq], seq, a.log.split("/")[-1], names, seeds, a.input)
|
||||
if a.out:
|
||||
with open(a.out, "w") as f:
|
||||
f.write(text)
|
||||
|
|
|
|||
1361
verify/results/turncommands/cb-turn2to3.json
Normal file
1361
verify/results/turncommands/cb-turn2to3.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,5 +1,6 @@
|
|||
tcb 1
|
||||
meta source l4-turn1to2-aiorders.txt
|
||||
meta input turn1-state.sav
|
||||
meta batch seq=2 n=8
|
||||
meta note the load-time batch is excluded; this is the End-Turn submission
|
||||
block 0 16
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
tcb 1
|
||||
meta source l4-turn2to3-aiorders.txt
|
||||
meta input turn2-state.sav
|
||||
meta batch seq=2 n=8
|
||||
meta note the load-time batch is excluded; this is the End-Turn submission
|
||||
block 0 16
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue