1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright 2024-2026 Jonathan Shook
// SPDX-License-Identifier: Apache-2.0
//! Scope-construction substrate for nmbrs-runtime.
//!
//! Module name disambiguates from the pre-existing
//! [`crate::synthesis`] (which handles fiber/op synthesis). Here
//! we handle **scope** synthesis — turning workload-shape intent
//! (a comprehension, a do-loop, a phase, an op template) into a
//! child [`polydat::kernel::PolydatKernel`].
//!
//! This module hosts the walking + Surface #7 helpers + scope-
//! builder functions that drive [`polydat::kernel::subcontext::SubcontextBuilder`]
//! to materialize new scope kernels. See
//! `polydat/docs/design/comprehension_cutover_contact_surfaces.md`
//! for the architectural framing.
//!
//! ## What's here
//!
//! - [`helpers`] — Surface #7: pure utilities for turning typed
//! values, workload-param strings, and PortType variants into
//! Polydat source literals / extern type names. Also the placeholder
//! scanner used by every scope-builder walk.
//!
//! ## What's planned (PR 9c-1b in progress)
//!
//! - `cascade` — the shared cascade-extern walker that the four
//! sister scope builders (`build_phase_scope_kernel`,
//! `build_do_loop_scope_kernel`, `build_op_template_scope_kernel`,
//! and the forthcoming `build_for_each_scope_kernel`) will
//! consume in lieu of each reinventing the same walk.
//! - `for_each` — the comprehension-specific iter-var emission +
//! shared cascade walker invocation that replaces
//! `polydat::iteration::comprehension::synthesize_for_each_scope`.
//!
//! ## What lives in `scope.rs` for now
//!
//! `build_phase_scope_kernel`, `build_do_loop_scope_kernel`,
//! `build_op_template_scope_kernel`. These will migrate into this
//! module (and refactor onto the shared cascade walker) as part of
//! the same push.
pub use ;
pub use emit_workload_param_chain_aware;
pub use build_for_each_scope_kernel;
pub use ;