Skip to content

A --copy session fails to build on Windows when a shader path passes 260 characters #97

Open

Description

@5hif7y

Related to #13

What happens

mirai session start demo --copy in the worktree mirai/.worktrees/profilers failed to build. The include path of an FSR shader header was 279 characters, over the 260-character limit of Windows paths.

  • The copy lives under demo/.mirai/tmp/session-copy-<n>/, which adds about 40 characters to every path of the project.
  • The FSR plugin's headers are deep already.
  • Without --copy the same build works.
  • AGENTS.md asks for --copy for sessions against the editor, so on Windows the rule can fail in a deep checkout.

Found while verifying #13. Not reproduced outside that worktree.

Expected

A --copy session builds wherever the checkout builds. For example, a shorter copy folder (outside the project, or a short name), or long paths (\\?\) where the build opens files.

🤖 Generated with Claude Code

Activity

  1. self-assigned this
    on Nov 15, 2026
  2. 5hif7y commented on Nov 15, 2026

    @5hif7y
    MemberAuthor

    Tried to reproduce on main b33d9a2, and it did not fail.

    • I ran mirai session start demo --copy from a worktree at the same depth as the one in the report (mirai/.worktrees/copy-path, 83 characters, like .worktrees/profilers).
    • The copy built: assets, 57 plugin libraries and editor.dll (214 s). The API then did not answer in 180 s, which is the cold software tracer of How many pipelines compile at once follows the cores, not the memory each compile takes #91, not this.
    • In that layout, the deepest FSR header staged into a copy is 264 characters:
      <root>/demo/.mirai/tmp/session-copy-<10 digits>/.mirai/shaders/include/programs/plugins/fsr/fsr3/frameinterpolation/ffx_frameinterpolation_reconstruct_dilated_velocity_and_previous_depth.h
      Odin's own file calls handle it, so the path alone does not break the build.
    • The failed copy of the report (.worktrees/profilers/demo/.mirai/tmp/session-copy-2018504842) kept empty .err and .out logs, so the failing tool and the exact 279-character path are not recorded.
    • Most likely the failure needs a shader compile on a cache miss, where an external tool (slangc) opens the header without long-path support. My run reused every stage.

    What would settle it: a --copy session whose project shaders miss the cache, in a checkout at least this deep, keeping the shader tool's output. I am not opening a PR until that names the tool, so the fix (a shorter copy folder, or the long-path form for that tool) goes where the limit really is.

    🤖 Generated with Claude Code

  3. 5hif7y commented on Nov 16, 2026

    @5hif7y
    MemberAuthor

    Reproduced outside a worktree, in the main checkout, with mirai session start demo --copy. The failing path is 261 characters:

    mirai build: could not generate the shaders of the project: could not copy the programs of …/plugins/fsr/shaders: …/demo/.mirai/tmp/session-copy-0401953508/.mirai/.mirai-shaders-7622721470/include/programs/plugins/fsr/fsr3/frameinterpolation/ffx_frameinterpolation_compute_game_vector_field_inpainting_pyramid.h could not be written (Not_Exist)
    

    The likely cause:

    • copy_sources in cook/shaders/programs.odin (around line 567) writes with os.make_directory_all and os.write_entire_file. Those take the path as it is.
    • std/serial/file_windows.odin (file_wide) already handles long paths: past 248 characters it makes the path absolute and prefixes \?\. The copy of the programs does not go through it.

    Writing those files through serial, or a long-path-aware directory creation, may fix it without shortening the copy folder.

    🤖 Generated with Claude Code

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions