Sarek_unloweredval table : ((string option * string) * Sarek_error.unlowered_reason) listThe one table of refused intrinsics, keyed by (module short name, intrinsic name): None is a core primitive (see Sarek_core_primitives), Some m an intrinsic registered by a module whose SHORT name is m (the last component of its module path).
The typer looks a name up here only AFTER resolving it to an intrinsic, so a kernel variable that merely shares a name is never refused.
The core-primitive entries and their variance/convergence classes stay in Sarek_core_primitives: Sarek_convergence keeps checking them, so warp-scope supersteps (roadmap S1) start from a checked base.
COUPLING: a row here has two effects. It refuses the intrinsic, and (through is_refused_name and Sarek_env.add_local_fun) it makes a kernel-local or [@sarek.module] function of the same name shadow the intrinsic. Removing a row therefore also changes how such a helper resolves: it goes back to losing to the intrinsic, as every non-refused intrinsic name does today. test_unlowered.ml pins this.
val reason :
module_short:string option ->
name:string ->
Sarek_error.unlowered_reason optionThe refusal reason for a resolved intrinsic: module_short is None for a core primitive, else the short name of the registering module.
Does any row of table have this intrinsic name?
val reason_of_qualified_name :
string ->
(string * Sarek_error.unlowered_reason) optionThe refusal for a module-qualified spelling of a refused intrinsic. Gpu.warp_ballot and Std.warp_ballot name the same primitive as the bare warp_ballot, but core primitives are registered under their short name only, so the qualified spelling would otherwise be reported as unknown.
This keys on the module's SHORT name, the last component of the qualifier, and only Gpu and Std qualify (Std is an alias of Gpu, so both reach both the core primitives and Gpu's own intrinsics). Another module that happens to be called Gpu would be treated the same. Returns the intrinsic's base name and the reason.