Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capability System: Redesign how failed capability providence is described to a user #4172

Closed
ArielG-NV opened this issue May 15, 2024 · 3 comments · Fixed by #4678
Closed
Assignees
Labels
goal:quality & productivity Quality issues and issues that impact our productivity coding day to day inside slang kind:enhancement a desirable new feature, option, or behavior

Comments

@ArielG-NV
Copy link
Contributor

ArielG-NV commented May 15, 2024

Currently in the capabilities system, erroring once we reach a stage of checking EntryPoints<->compileTarget (Diagnostics::entryPointUsesUnavailableCapability) produces assumptions of what went wrong.

These assumptions assumes based on providence of a single Decl that any incompatible capability may be the problem. This erroring works well when the problem is straight-forward or the function has little capabilities defined. When the problem is within a function with many overlapping capabilities the current "providence" tracking provides little assistance in erroring due to only tracking a single "providence".

One solution to this would be to redesign the approach to store UIntSets of callee and parent functions that remove a target

  • It would be faster to save debug data but slower to emit debug information.
@ArielG-NV ArielG-NV changed the title Capability Capability System: Redesign how failed capabilities on EntryPoints are managed May 15, 2024
@ArielG-NV ArielG-NV changed the title Capability System: Redesign how failed capabilities on EntryPoints are managed Capability System: Redesign how failed capabilities on EntryPoints are described to a user May 15, 2024
@ArielG-NV ArielG-NV added kind:enhancement a desirable new feature, option, or behavior goal:quality & productivity Quality issues and issues that impact our productivity coding day to day inside slang labels May 15, 2024
@ArielG-NV ArielG-NV changed the title Capability System: Redesign how failed capabilities on EntryPoints are described to a user Capability System: Redesign how failed capabilities on EntryPoints<->compileTarget are described to a user May 15, 2024
@ArielG-NV ArielG-NV changed the title Capability System: Redesign how failed capabilities on EntryPoints<->compileTarget are described to a user Capability System: Redesign how failed capability providence is described to a user Jul 18, 2024
@ArielG-NV
Copy link
Contributor Author

ArielG-NV commented Jul 18, 2024

example of why this needs fixing (notice the repeat of errors):

shader.hlsl(11): error 36107: entrypoint 'main' requires capability 'textualTarget + cuda + cuda_sm_1_0 + cuda_sm_2_0 + cuda_sm_3_0 + cuda_sm_3_5 + cuda_sm_4_0 + cuda_sm_5_0 + cuda_sm_6_0 + cuda_sm_7_0 + vertex | textualTarget + cuda + cuda_sm_1_0 + cuda_sm_2_0 + cuda_sm_3_0 + cuda_sm_3_5 + cuda_sm_4_0 + cuda_sm_5_0 + cuda_sm_6_0 + cuda_sm_7_0 + fragment | textualTarget + cuda + cuda_sm_1_0 + cuda_sm_2_0 + cuda_sm_3_0 + cuda_sm_3_5 + cuda_sm_4_0 + cuda_sm_5_0 + cuda_sm_6_0 + cuda_sm_7_0 + compute | textualTarget + cuda + cuda_sm_1_0 + cuda_sm_2_0 + cuda_sm_3_0 + cuda_sm_3_5 + cuda_sm_4_0 + cuda_sm_5_0 + cuda_sm_6_0 + cuda_sm_7_0 + hull | textualTarget + cuda + cuda_sm_1_0 + cuda_sm_2_0 + cuda_sm_3_0 + cuda_sm_3_5 + cuda_sm_4_0 + cuda_sm_5_0 + cuda_sm_6_0 + cuda_sm_7_0 + domain | textualTarget + cuda + cuda_sm_1_0 + cuda_sm_2_0 + cuda_sm_3_0 + cuda_sm_3_5 + cuda_sm_4_0 + cuda_sm_5_0 + cuda_sm_6_0 + cuda_sm_7_0 + geometry | textualTarget + cuda + cuda_sm_1_0 + cuda_sm_2_0 + cuda_sm_3_0 + cuda_sm_3_5 + cuda_sm_4_0 + cuda_sm_5_0 + cuda_sm_6_0 + cuda_sm_7_0 + raygen | textualTarget + cuda + cuda_sm_1_0 + cuda_sm_2_0 + cuda_sm_3_0 + cuda_sm_3_5 + cuda_sm_4_0 + cuda_sm_5_0 + cuda_sm_6_0 + cuda_sm_7_0 + intersection | textualTarget + cuda + cuda_sm_1_0 + cuda_sm_2_0 + cuda_sm_3_0 + cuda_sm_3_5 + cuda_sm_4_0 + cuda_sm_5_0 + cuda_sm_6_0 + cuda_sm_7_0 + anyhit | textualTarget + cuda + cuda_sm_1_0 + cuda_sm_2_0 + cuda_sm_3_0 + cuda_sm_3_5 + cuda_sm_4_0 + cuda_sm_5_0 + cuda_sm_6_0 + cuda_sm_7_0 + closesthit | textualTarget + cuda + cuda_sm_1_0 + cuda_sm_2_0 + cuda_sm_3_0 + cuda_sm_3_5 + cuda_sm_4_0 + cuda_sm_5_0 + cuda_sm_6_0 + cuda_sm_7_0 + miss | textualTarget + cuda + cuda_sm_1_0 + cuda_sm_2_0 + cuda_sm_3_0 + cuda_sm_3_5 + cuda_sm_4_0 + cuda_sm_5_0 + cuda_sm_6_0 + cuda_sm_7_0 + mesh | textualTarget + cuda + cuda_sm_1_0 + cuda_sm_2_0 + cuda_sm_3_0 + cuda_sm_3_5 + cuda_sm_4_0 + cuda_sm_5_0 + cuda_sm_6_0 + cuda_sm_7_0 + amplification | textualTarget + cuda + cuda_sm_1_0 + cuda_sm_2_0 + cuda_sm_3_0 + cuda_sm_3_5 + cuda_sm_4_0 + cuda_sm_5_0 + cuda_sm_6_0 + cuda_sm_7_0 + callable | textualTarget + hlsl + sm_4_0 + sm_4_1 + sm_5_0 + sm_5_1 + sm_6_0 + sm_6_1 + sm_6_2 + sm_6_3 + sm_6_4 + sm_6_5 + vertex | textualTarget + hlsl + sm_4_0 + sm_4_1 + sm_5_0 + sm_5_1 + sm_6_0 + sm_6_1 + sm_6_2 + sm_6_3 + sm_6_4 + sm_6_5 + fragment | textualTarget + hlsl + sm_4_0 + sm_4_1 + sm_5_0 + sm_5_1 + sm_6_0 + sm_6_1 + sm_6_2 + sm_6_3 + sm_6_4 + sm_6_5 + compute | textualTarget + hlsl + sm_4_0 + sm_4_1 + sm_5_0 + sm_5_1 + sm_6_0 + sm_6_1 + sm_6_2 + sm_6_3 + sm_6_4 + sm_6_5 + hull | textualTarget + hlsl + sm_4_0 + sm_4_1 + sm_5_0 + sm_5_1 + sm_6_0 + sm_6_1 + sm_6_2 + sm_6_3 + sm_6_4 + sm_6_5 + domain | textualTarget + hlsl + sm_4_0 + sm_4_1 + sm_5_0 + sm_5_1 + sm_6_0 + sm_6_1 + sm_6_2 + sm_6_3 + sm_6_4 + sm_6_5 + geometry | textualTarget + hlsl + sm_4_0 + sm_4_1 + sm_5_0 + sm_5_1 + sm_6_0 + sm_6_1 + sm_6_2 + sm_6_3 + sm_6_4 + sm_6_5 + raygen | textualTarget + hlsl + sm_4_0 + sm_4_1 + sm_5_0 + sm_5_1 + sm_6_0 + sm_6_1 + sm_6_2 + sm_6_3 + sm_6_4 + sm_6_5 + intersection | textualTarget + hlsl + sm_4_0 + sm_4_1 + sm_5_0 + sm_5_1 + sm_6_0 + sm_6_1 + sm_6_2 + sm_6_3 + sm_6_4 + sm_6_5 + anyhit | textualTarget + hlsl + sm_4_0 + sm_4_1 + sm_5_0 + sm_5_1 + sm_6_0 + sm_6_1 + sm_6_2 + sm_6_3 + sm_6_4 + sm_6_5 + closesthit | textualTarget + hlsl + sm_4_0 + sm_4_1 + sm_5_0 + sm_5_1 + sm_6_0 + sm_6_1 + sm_6_2 + sm_6_3 + sm_6_4 + sm_6_5 + miss | textualTarget + hlsl + sm_4_0 + sm_4_1 + sm_5_0 + sm_5_1 + sm_6_0 + sm_6_1 + sm_6_2 + sm_6_3 + sm_6_4 + sm_6_5 + mesh | textualTarget + hlsl + sm_4_0 + sm_4_1 + sm_5_0 + sm_5_1 + sm_6_0 + sm_6_1 + sm_6_2 + sm_6_3 + sm_6_4 + sm_6_5 + amplification | textualTarget + hlsl + sm_4_0 + sm_4_1 + sm_5_0 + sm_5_1 + sm_6_0 + sm_6_1 + sm_6_2 + sm_6_3 + sm_6_4 + sm_6_5 + callable', which is incompatible with the current compilation target 'spirv_1_0 + spirv_1_1 + spirv_1_2 + spirv_1_3 + spirv_1_4 + spirv_1_5 + fragment + SPV_KHR_fragment_shader_barycentric + SPV_EXT_fragment_fully_covered + SPV_EXT_shader_atomic_float_add + SPV_EXT_shader_atomic_float_min_max + SPV_EXT_mesh_shader + SPV_KHR_ray_tracing + SPV_KHR_ray_query + SPV_GOOGLE_user_type'.
uint4 main(int4 input0 : ATTR0, uint4 input1 : ATTR1) : SV_Target {
      ^~~~
hlsl.meta.slang(14867): note: see using of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see definition of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see using of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see definition of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see using of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see definition of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see using of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see definition of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see using of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see definition of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see using of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see definition of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see using of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see definition of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see using of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see definition of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see using of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see definition of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see using of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see definition of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see using of 'WaveMultiPrefixProduct'
hlsl.meta.slang(14867): note: see definition of 'WaveMultiPrefixProduct'```

@jkwak-work
Copy link
Collaborator

I think this issue needs a "repro steps".
Once we have a repro steps, anybody can pick it up and work on it.
And we can also verify the fix later by running the repro steps again.

@ArielG-NV
Copy link
Contributor Author

Repro: #4443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
goal:quality & productivity Quality issues and issues that impact our productivity coding day to day inside slang kind:enhancement a desirable new feature, option, or behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants