Skip to content

[Self-Hosting Phase 2] Port Shader DSL to Native Flow #683

Closed

Description

@godofecht

Scope

Port shader block parsing and pipeline binding validation from src/flow/shader_dsl.py into compiler/src/shader_dsl.flow.

Deliverables

  • Parse shader fill and compute shader declarations.
  • Uniform buffer layout validation and vertex attribute binding.
  • Stage input/output interface matching.
  • Validate with examples/graphics/shader_demo.flow.

Activity

  1. added
    self-hosting
    P2-medium
    on Aug 21, 2026
  2. godofecht commented on Sep 12, 2026

    @godofecht
    ContributorAuthor

    Implementation merged in #890: shader_dsl.flow (real parse/validate), KW_SHADER, AST_SHADER, and parser/typecheck hooks. Bootstrap self-reproduces and the full corpus verify passes. The session's shipped test_backend_shader was an empty stub (def ...: pass) so it was dropped. Keeping open until a functional test compiles a 'shader fill' program through the bootstrap flowc and asserts on the output.

  3. godofecht commented on Sep 13, 2026

    @godofecht
    ContributorAuthor

    Maintenance update, 2026-09-13: #890 merged the self-hosted Shader DSL front-end slice as 75e78325064f31bd8cd53ba0f676be02eb0973d7. It adds compiler/src/shader_dsl.flow, KW_SHADER, AST_SHADER, and parser/typecheck hooks for shader fill / shader compute; the merged PR records regenerated bootstrap, fixed-point success, and bootstrap_from_c.sh --verify success.

    This issue should remain open: #890 explicitly notes that the shipped test was an empty stub and was dropped. The remaining actionable acceptance gap is a real functional self-hosted shader-program regression covering at least one fill and one compute declaration, including validation/binding behavior and the intended examples/graphics/shader_demo.flow path, then local execution against the current tree. Do not close #683 until that functional coverage exists.

  4. godofecht commented on Sep 16, 2026

    @godofecht
    ContributorAuthor

    Progress in current checkout: added compiler/src/shader_dsl.flow with bounds-checked fill/compute declaration scanning, zero-copy name/body spans, comment and quoted-brace handling, nested-brace matching, and malformed-block rejection. Added tests/lang/test_shader_dsl_native.flow; native bootstrap fixture passes, Python-host compiler selftest passes, bootstrap fixed point passes, bootstrap_from_c.sh --verify passes, and self_host_full passes. Issue remains open for shader-body parsing/validation, binding/interface checks, and codegen integration.

  5. godofecht commented on Sep 16, 2026

    @godofecht
    ContributorAuthor

    Additional progress: flowc.shader_dsl now validates non-empty declarations and requires fill shaders to assign the color output, while compute declarations require a non-empty body. Native positive/negative fixture passes, including quoted/nested braces and unclosed/missing-color rejection. Python-host selftest, bootstrap fixed point, bootstrap_from_c verification, and self_host_full all pass. Full shader-body grammar and pipeline binding/interface integration remain open.

  6. godofecht commented on Sep 16, 2026

    @godofecht
    ContributorAuthor

    Production integration completed for the next slice: resolve.flow now invokes flowc_shader_validate before expanding shader fill blocks. Valid fills continue through the compatibility stub path; malformed/unclosed fills and fills without color assignment are rejected. Added tests/integration/test_native_shader_dsl.py covering valid and invalid bundle behavior. Native scanner fixture, Python-host selftest, bootstrap fixed point, bootstrap_from_c verification, and self_host_full all pass. Full shader-body grammar and pipeline binding/interface integration remain open.

  7. godofecht commented on Sep 16, 2026

    @godofecht
    ContributorAuthor

    Further native shader-body validation: added balanced-parenthesis/bracket/quote checks and rejected empty color assignments. Native fixture covers unbalanced vec4(...) and color = } failures; Python-host selftest, bootstrap fixed point, bootstrap_from_c verification, and self_host_full all pass. Full shader expression grammar and pipeline binding/interface integration remain open.

  8. 11 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-mediumcompilerself-hosting

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions