Skip to content

should we add failure cases for imports/conditional translation? #8

@k2d222

Description

@k2d222

for some failure cases, the linker does not have to check them and can rely on the output code being invalid. But some are more sneaky and could actually generate valid but unpredictable WGSL code. Examples:

import/declaration name conflict.

import foo::bar;
import util::bar;
fn bar() {}

fn main() {
    bar(); // which one is picked? They are all mangled differently
}

shadowing built-ins webgpu-tools/wesl-spec#70 since the last consensus was to not shadow root module declarations, shadowing builtins in the root module has action at a distance. Probably we should change that behavior though.

// module root.wgsl
fn f32() {}

// module util.wgsl
const x: f32 = 0; // invalid: f32 was overriden in the root module and is not mangled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions