Skip to content

Commit 3893318

Browse files
authored
Merge pull request #6 from raws-labs/hardening/plan-sized-workspace
Measure plan-sized executor metadata
2 parents 24048ee + a1699a5 commit 3893318

3 files changed

Lines changed: 30 additions & 9 deletions

File tree

core-versions.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
22
"format_version": 1,
3-
"profile": "coordinated-develop-2026-07-15",
3+
"profile": "plan-sized-workspace-2026-07-19",
44
"plan_schema": 4,
55
"compatibility_manifest": {
66
"repository": "https://github.com/raws-labs/tigris.git",
77
"path": "compatibility.json",
8-
"commit": "f8a188d5bbf0d9a7f6dc9b1bf35836b4b9bffaf1"
8+
"commit": "69b8b7d93628e8f32ec101bee78113ec1f05fb89"
99
},
1010
"compiler": {
1111
"repository": "https://github.com/raws-labs/tigris.git",
1212
"branch": "develop",
13-
"commit": "f8a188d5bbf0d9a7f6dc9b1bf35836b4b9bffaf1",
13+
"commit": "69b8b7d93628e8f32ec101bee78113ec1f05fb89",
1414
"emits_schema": 4
1515
},
1616
"runtime": {
1717
"repository": "https://github.com/raws-labs/tigris-runtime.git",
1818
"branch": "develop",
19-
"commit": "89170124df0b67a57d9c4322645b92bd4e79c387",
19+
"commit": "e9fd8020c2f2a8c42871b0601de492341ad18428",
2020
"accepts_schemas": [2, 3, 4]
2121
}
2222
}

cortex-m-deployability/harness/main.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ extern const unsigned int g_tigris_plan_len;
6363
static uint8_t s_fast_arena[TIGRIS_FAST_ARENA_BYTES] __attribute__((aligned(16)));
6464
static uint8_t s_slow_arena[TIGRIS_SLOW_ARENA_BYTES] __attribute__((aligned(16)));
6565
static void *s_tensor_ptrs[BENCH_MAX_TENSORS];
66-
static tigris_executor_workspace_t s_executor_workspace;
66+
static uint8_t s_executor_workspace[
67+
TIGRIS_CODEGEN_EXECUTOR_WORKSPACE_BYTES];
6768

6869
static const char *kernel_name(void)
6970
{
@@ -131,12 +132,14 @@ static uint32_t run_once(tigris_plan_t *plan, tigris_mem_t *mem,
131132
tigris_exec_stats_t stats;
132133
uint32_t c0 = platform_cycles();
133134
#ifdef BENCH_PROFILE_OPS
134-
tigris_exec_error_t err = tigris_run_with_workspace(
135-
plan, mem, dispatch, NULL, &stats, &s_executor_workspace);
135+
tigris_exec_error_t err = tigris_run_with_workspace_buffer(
136+
plan, mem, dispatch, NULL, &stats, s_executor_workspace,
137+
sizeof(s_executor_workspace));
136138
#else
137139
(void)dispatch; /* generated core owns the normal dispatch call. */
138-
tigris_exec_error_t err = tigris_codegen_run(
139-
plan, mem, &stats, &s_executor_workspace);
140+
tigris_exec_error_t err = tigris_codegen_run_with_workspace_buffer(
141+
plan, mem, &stats, s_executor_workspace,
142+
sizeof(s_executor_workspace));
140143
#endif
141144
uint32_t c1 = platform_cycles();
142145

tests/test_provenance.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,5 +287,23 @@ def test_rp2350_requires_pico_sdk_revision(self) -> None:
287287
)
288288

289289

290+
class HarnessWorkspaceContractTest(unittest.TestCase):
291+
def test_tigris_metadata_uses_generated_plan_sized_workspace(self) -> None:
292+
harness = (
293+
ROOT / "cortex-m-deployability/harness/main.c").read_text()
294+
295+
self.assertIn(
296+
"s_executor_workspace[\n"
297+
" TIGRIS_CODEGEN_EXECUTOR_WORKSPACE_BYTES]",
298+
harness,
299+
)
300+
self.assertIn("tigris_codegen_run_with_workspace_buffer(", harness)
301+
self.assertIn("tigris_run_with_workspace_buffer(", harness)
302+
self.assertIn(
303+
"sizeof(s_executor_workspace)", harness)
304+
self.assertNotIn(
305+
"tigris_executor_workspace_t s_executor_workspace", harness)
306+
307+
290308
if __name__ == "__main__":
291309
unittest.main()

0 commit comments

Comments
 (0)