vms: raise the step cap from 5M to 20M

5 million steps was picked when the worst macro (clb_add_ip with B=2047) sat just
under a million, so it caught hangs quickly.  The interactive programs changed the
arithmetic: one printed line of the desk calculator costs about 225k steps (40k
for clb_undigits, up to 32k for the operation, ~141k for clb_digits), which is only
about twenty lines before the cap, and examples_test applies the same cap to every
example.

At roughly 2.3e8 steps per second a 20M cap costs 0.09 s when a program really does
run away, and byte_op_test (the only place that runs 465k programs) is unchanged --
so the safety net stays cheap while a session gets four times the room.

docs/calc.md, docs/divmod.md, docs/byte-ops.md and SPEC's "500 ?" mentions now say
2000 ?.
This commit is contained in:
dsh committed 2026-11-11 11:04:14 +08:00
1 parent b83f3b1b06
commit b2ba20b885
8 files changed
+16 -16

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ struct machine {
return uint32_t((v >> 1) | ((v & 1u) << (kDefaultCellSize - 1)));
}
void run(const std::string &tape, size_t limit = 5'000'000) {
void run(const std::string &tape, size_t limit = 20'000'000) {
for (size_t pc = 0; pc < tape.size() && limit; pc++, limit--) {
switch (tape[pc]) {
case '>':