Make renumber scratch runtime-owned #50

Open
logikoma wants to merge 1 commits from 12 into main
Collaborator

Closes #12

Moves RENUMBER and target-prescan scratch storage into akbasic_Runtime, rewrites lines through one runtime-owned scratch line, and applies the mapping with in-place permutation cycles. The preflight and error behavior remain unchanged.

Verification: cmake --build build-34 --parallel 2; ctest --test-dir build-34 --output-on-failure (113/113 passed).

Closes #12 Moves RENUMBER and target-prescan scratch storage into akbasic_Runtime, rewrites lines through one runtime-owned scratch line, and applies the mapping with in-place permutation cycles. The preflight and error behavior remain unchanged. Verification: cmake --build build-34 --parallel 2; ctest --test-dir build-34 --output-on-failure (113/113 passed).
logikoma added 1 commit 2026-08-05 18:37:16 -04:00
Make renumber scratch runtime-owned
Some checks failed
akbasic CI Build / cmake_build (push) Successful in 4m21s
akbasic CI Build / akgl_build (push) Failing after 12m38s
akbasic CI Build / coverage (push) Failing after 12m56s
akbasic CI Build / sanitizers (push) Failing after 13m5s
akbasic CI Build / mutation_test (push) Successful in 18m7s
e20fd445a4
Co-authored-by: Andrew Kesterson <andrew@starfort.tech>
logikoma requested review from andrew 2026-08-05 18:37:23 -04:00
andrew requested changes 2026-08-05 18:46:52 -04:00
@@ -384,0 +389,4 @@
if ( map[i] < 0 || obj->renumber_visited[i] ) {
continue;
}
PASS(errctx, aksl_memcpy(&displaced, &obj->source[i], sizeof(displaced)));
Owner

Couldn't all of these aksl_memcpy calls in this loop be aksl_strncpy() calls sized to AKBASIC_MAX_LINE_LENGTH? That would be faster, since very few lines will fill all of the bytes in their line. We don't actually care if everything in the line gets initialized to zero, we just want the new null-terminated string in there. This would save cycles.

Couldn't all of these `aksl_memcpy` calls in this loop be `aksl_strncpy()` calls sized to `AKBASIC_MAX_LINE_LENGTH`? That would be faster, since very few lines will fill all of the bytes in their line. We don't actually care if *everything* in the line gets initialized to zero, we just want the new null-terminated string in there. This would save cycles.
Owner

@logikoma Couldn't all of these aksl_memcpy calls in this loop be aksl_strncpy() calls sized to AKBASIC_MAX_LINE_LENGTH? That would be faster, since very few lines will fill all of the bytes in their line. We don't actually care if everything in the line gets initialized to zero, we just want the new null-terminated string in there. This would save cycles.

@logikoma Couldn't all of these aksl_memcpy calls in this loop be aksl_strncpy() calls sized to AKBASIC_MAX_LINE_LENGTH? That would be faster, since very few lines will fill all of the bytes in their line. We don't actually care if everything in the line gets initialized to zero, we just want the new null-terminated string in there. This would save cycles.
Some checks failed
akbasic CI Build / cmake_build (push) Successful in 4m21s
Required
Details
akbasic CI Build / akgl_build (push) Failing after 12m38s
Required
Details
akbasic CI Build / coverage (push) Failing after 12m56s
Required
Details
akbasic CI Build / sanitizers (push) Failing after 13m5s
Required
Details
akbasic CI Build / mutation_test (push) Successful in 18m7s
Required
Details
This pull request doesn't have enough required approvals yet. 0 of 1 approvals granted from users or teams on the allowlist.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 12:12
git checkout 12
Sign in to join this conversation.