feat(v4.0.0): the host node's stacks are 32 deep (D-17)
With the stacks counted and guarded (D-16) their size is a parameter of the node. The host node, which runs the interpreter and the compiler under the user's programme, gets 32 values and 32 return entries; a mesh node keeps the F18's 10 and 9. Nothing else about the mechanism or any word's definition changes. - stack.h: V4_DATA_RING and V4_RET_RING are build parameters; the Makefile sets them for the host-node tests. - tests/test_host_quit.c no longer assumes a size: it fills the stacks to whatever they are, and takes every exit with the return stack full. - Measured on the host node now: 28 values on a line, 29 waiting between lines, words 31 deep from the prompt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
0da7e32a0b
commit
ebffa6082d
@@ -395,15 +395,15 @@ int main(void)
|
||||
|
||||
/* ---- how many values a line may have on the stack ---- */
|
||||
{
|
||||
char line[96];
|
||||
char line[4 * V4_DATA_DEPTH + 16];
|
||||
unsigned k, most = 0;
|
||||
new_session();
|
||||
for (k = 1; k <= 9; k++) {
|
||||
for (k = 1; k < V4_DATA_DEPTH; k++) {
|
||||
size_t at = 0;
|
||||
unsigned m;
|
||||
for (m = 0; m < k; m++) at += (size_t)snprintf(line + at, sizeof line - at, "%u ", m + 1);
|
||||
for (m = 0; m < k; m++) at += (size_t)snprintf(line + at, sizeof line - at, "1 ");
|
||||
for (m = 1; m < k; m++) at += (size_t)snprintf(line + at, sizeof line - at, "+ ");
|
||||
if (one(line) == (v4_cell)(k * (k + 1) / 2)) most = k; else break;
|
||||
if (one(line) == (v4_cell)k) most = k; else break;
|
||||
}
|
||||
printf(" a line may have %u values on the stack while the interpreter reads its next word\n", most);
|
||||
CHECK(most >= 6, "the interpreter leaves most of the stack to the user");
|
||||
|
||||
Reference in New Issue
Block a user