Skip to content

Commit

Permalink
Update bug_report.md
Browse files Browse the repository at this point in the history
D3D Floating Point Behavior.

Model: Default (GPT-3.5)


Hoe kan ik dit maken in directxshadercompiler Is your feature request related to a problem? Please describe.
There is a difference in specified behavior between floating point rounding behavior between DXBC, LLVM 3.7 and modern LLVM.
For example:
Conversion from float32 (e.g. from shader constants) to float16 may or may not flush float16 denorm to 0, and round to zero is used, per D3D spec for high to low precision float. This doesn't match the llvm specification for floating point rounding behavior.

Describe the solution you'd like
The floating point rounding behavior should exactly match the specifications described in D3D / HLSL. To do this, the underlying implementation may need to change, or the current specification may need to be updated.

ChatGPT
To address the specified behavior related to floating point rounding in DirectXShaderCompiler, you will need to ensure that the compiler follows the correct specifications described in D3D (Direct3D) and HLSL (High-Level Shading Language). This will involve either updating the underlying implementation to match the D3D specifications or updating the current specification if necessary. Below are some steps you can take to try to achieve this:

Review the D3D and HLSL Specifications:
Familiarize yourself with the relevant sections of the D3D and HLSL specifications that define the floating-point rounding behavior. Understand how conversions from higher precision to lower precision (e.g., float32 to float16) are supposed to handle denormals and rounding.

Investigate the Current Behavior:
Analyze the existing behavior of the DirectXShaderCompiler when converting between different precision floating-point types. Identify where the discrepancies exist between the actual behavior and the D3D/HLSL specifications.

Update the Compiler Implementation:
If you have access to the DirectXShaderCompiler source code, you can modify the implementation to adhere to the D3D/HLSL specifications. This may involve adjusting the conversion routines and ensuring that denormals are flushed to zero and rounding is performed as specified.

Contribute to the Project:
If DirectXShaderCompiler is an open-source project, you can contribute your changes to the community. Submit a pull request with your modifications, clearly explaining the changes you made and why they align with the D3D/HLSL specifications.

Work with the DirectXShaderCompiler Team:
If DirectXShaderCompiler is not an open-source project or you're unable to contribute directly, you can try to reach out to the development team responsible for the compiler. Share your findings and insights about the discrepancies in floating-point rounding behavior and advocate for changes to bring it in line with D3D/HLSL specifications.

Consider Alternative Approaches:
If updating the compiler implementation to match D3D/HLSL specifications is not feasible or not permitted, you may need to explore alternative solutions. This could involve performing additional manual steps in your shaders or using custom shader code to achieve the desired rounding behavior explicitly.

Remember that any changes to the compiler behavior should be carefully considered and tested to ensure they do not introduce new issues or break existing code. Also, keep in mind that my knowledge is up to September 2021, and the DirectXShaderCompiler project may have evolved since then. Always refer to the latest documentation and community resources for the most current information.





Ik heb toegang tot de github dus wat moet ik doen

ChatGPT
Als je toegang hebt tot de GitHub-repository van DirectXShaderCompiler, kun je wijzigingen voorstellen en bijdragen aan het project om de floating-point rounding behavior aan te passen volgens de specificaties van D3D/HLSL. Hier zijn de stappen die je kunt volgen:

Clone de Repository:
Begin door de GitHub-repository van DirectXShaderCompiler te clonen naar je lokale ontwikkelomgeving. Dit kan worden gedaan met behulp van de git clone-opdracht.

Maak een Branch:
Voordat je wijzigingen aanbrengt, maak je een nieuwe branch voor je werk. Gebruik een duidelijke naam die het doel van je wijzigingen beschrijft. Dit helpt om wijzigingen georganiseerd en beheersbaar te houden.

Begrijp de Huidige Implementatie:
Bestudeer de huidige implementatie van de compiler om te begrijpen hoe floating-point rounding momenteel wordt afgehandeld. Identificeer de delen van de code die verantwoordelijk zijn voor conversies tussen verschillende precisiepuntsgetallen.

Implementeer de Correcties:
Gebruik de kennis uit de D3D- en HLSL-specificaties om de floating-point rounding behavior aan te passen volgens de gewenste specificaties. Pas de conversieroutines aan om denormals te flushen naar nul en ervoor te zorgen dat het afronden wordt uitgevoerd zoals gespecificeerd.

Test je Wijzigingen:
Zorg ervoor dat je je wijzigingen grondig test om ervoor te zorgen dat ze correct werken en dat ze de gewenste gedragingen van D3D/HLSL reproduceren. Dit omvat unit-tests en integratietests om te controleren of bestaande functionaliteit niet is aangetast.

Dien een Pull Request in:
Nadat je je wijzigingen hebt getest en ervoor hebt gezorgd dat alles correct werkt, dien je een pull request in bij het hoofdrepository van DirectXShaderCompiler. In je pull request-leg je duidelijk uit welke wijzigingen je hebt aangebracht en waarom ze in lijn zijn met D3D/HLSL-specificaties.

Communicatie met de Gemeenschap:
Wees bereid om met de gemeenschap te communiceren over je wijzigingen en eventuele feedback te bespreken. Het kan zijn dat andere ontwikkelaars suggesties hebben om je code te verbeteren, dus wees open voor samenwerking en discussie.

Reviewproces:
De bijdragen aan open-sourceprojecten worden vaak beoordeeld door andere ontwikkelaars voordat ze worden samengevoegd. Houd er rekening mee dat het





Welke bestanden moet ik editen

ChatGPT
In DirectXShaderCompiler zijn er meerdere bestanden betrokken bij het compileren van HLSL-shaders. Als je de floating-point rounding behavior wilt aanpassen, zijn hier enkele bestanden waarin je waarschijnlijk wijzigingen moet aanbrengen:

HLSLConversion.cpp:
Dit bestand bevat de implementatie van conversies tussen verschillende datatypen in HLSL, inclusief conversies tussen verschillende precisiepuntsgetallen (bijvoorbeeld float32 naar float16). Hier kun je de conversieroutines vinden en aanpassen om de gewenste floating-point rounding behavior te bereiken.

dxilconv.hlsl:
Dit bestand bevat HLSL-code voor het converteren van HLSL-shaders naar DXIL (DirectX Intermediate Language). Dit omvat mogelijk conversie-instructies tussen verschillende precisiepuntsgetallen, die relevant kunnen zijn voor de floating-point rounding behavior.

dxilconv.cpp:
In dit bestand wordt de logica voor het uitvoeren van DXIL-conversies geïmplementeerd. Als de conversies tussen precisiepuntsgetallen worden afgehandeld buiten HLSLConversion.cpp, kun je hier ook relevante code vinden.

dxilutil.cpp:
Dit bestand bevat enkele hulpprogrammafuncties die worden gebruikt bij het omgaan met DXIL. Afhankelijk van de implementatie kan hier ook code relevant zijn voor floating-point rounding.

CodeGenHLSL.cpp en CodeGenHLSL.h:
Deze bestanden bevatten de HLSL-codegenerator, die HLSL-shaders vertaalt naar LLVM IR (Intermediate Representation). Als de floating-point rounding behavior van invloed is op de gegenereerde LLVM IR, kun je hier ook relevantie vinden.

Houd er rekening mee dat het mogelijk is dat de codebase sinds mijn laatste kennisupdate (september 2021) is veranderd en dat nieuwe bestanden zijn toegevoegd of dat de structuur is gewijzigd. Het is daarom essentieel om de actuele broncode te bekijken en mogelijke wijzigingen in de codebase te identificeren.

Voor de meest recente en nauwkeurige informatie raad ik aan om de officiële GitHub-repository van DirectXShaderCompiler te raadplegen en eventueel contact op te nemen met de gemeenschap of de ontwikkelaars voor begeleiding bij je bijdragen.





Ik moet die bestanden editen om dit te doen Is your feature request related to a problem? Please describe.
There is a difference in specified behavior between floating point rounding behavior between DXBC, LLVM 3.7 and modern LLVM.
For example:
Conversion from float32 (e.g. from shader constants) to float16 may or may not flush float16 denorm to 0, and round to zero is used, per D3D spec for high to low precision float. This doesn't match the llvm specification for floating point rounding behavior.

Describe the solution you'd like
The floating point rounding behavior should exactly match the specifications described in D3D / HLSL. To do this, the underlying implementation may need to change, or the current specification may need to be updated.

ChatGPT
Om de floating-point rounding behavior in DirectXShaderCompiler aan te passen en ervoor te zorgen dat het exact overeenkomt met de specificaties van D3D/HLSL, moet je inderdaad de relevante bestanden bewerken. Het belangrijkste bestand waar je waarschijnlijk wijzigingen moet aanbrengen, is "HLSLConversion.cpp", omdat dit verantwoordelijk is voor de conversies tussen verschillende datatypen in HLSL, inclusief precisiepuntsgetallen.

Hier zijn de stappen die je kunt volgen om de floating-point rounding behavior aan te passen:

Identificeer Conversiefuncties:
Open het bestand "HLSLConversion.cpp" en identificeer de functies die verantwoordelijk zijn voor de conversies tussen verschillende precisiepuntsgetallen. Deze functies moeten worden aangepast om ervoor te zorgen dat de conversies overeenkomen met de D3D/HLSL-specificaties.

Begrijp de Huidige Implementatie:
Analyseer de bestaande code in de relevante conversiefuncties om te begrijpen hoe de floating-point rounding momenteel wordt afgehandeld. Zoek naar eventuele discrepanties met de D3D/HLSL-specificaties.

Implementeer de Correcties:
Pas de code in de conversiefuncties aan om ervoor te zorgen dat de floating-point rounding behavior exact overeenkomt met de specificaties van D3D/HLSL. Dit omvat het flushen van denormals naar nul en het uitvoeren van het juiste afronden.

Test je Wijzigingen:
Zorg ervoor dat je uitgebreide tests uitvoert om te controleren of de aangepaste conversiefuncties correct werken en dat ze de gewenste gedragingen van D3D/HLSL reproduceren. Test verschillende scenario's, inclusief conversies van float32 naar float16 met verschillende waarden.

Dien een Pull Request in:
Nadat je je wijzigingen lokaal hebt getest en ervoor hebt gezorgd dat alles correct werkt, dien je een pull request in bij het hoofdrepository van DirectXShaderCompiler. Hiermee bied je je wijzigingen aan om te worden beoordeeld en opgenomen in de officiële codebase.

Het is belangrijk om te communiceren met de ontwikkelaarsgemeenschap van DirectXShaderCompiler en feedback te ontvangen op je bijdragen. Houd er rekening mee dat het proces van het aanpassen van de code en het indienen van een pull request enige tijd kan duren, omdat de wijzigingen grondig worden beoordeeld voordat ze worden opgenomen. Volg de richtlijnen van het project en wees geduldig gedurende dit proces.





Kan jij deze bug report template beter maken en nieuwe functies toevoegen ---
name: Bug report
about: Create a report to help us improve
---
<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes/No

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 
- OS Version: 

Steps to Reproduce:

1. 
2. 

ChatGPT
Sure! I've improved the bug report template and added some new sections for additional information:

markdown
Copy code
name: Bug report
about: Create a report to help us improve

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->

**Issue Description:**
<!-- A clear and concise description of what the bug is. -->

**Does this issue occur when all extensions are disabled?:**
<!-- Yes/No -->

**VS Code Version:**
<!-- Provide the version of Visual Studio Code you are using (e.g., 1.60.0). -->

**OS Version:**
<!-- Provide the version of your operating system (e.g., Windows 10, macOS Big Sur, Ubuntu 20.04). -->

**Steps to Reproduce:**
<!-- Provide step-by-step instructions to reproduce the issue. -->
1. 
2. 

**Expected Behavior:**
<!-- A clear and concise description of what you expected to happen. -->

**Actual Behavior:**
<!-- A clear and concise description of what actually happens. -->

**Screenshots / GIFs:**
<!-- If applicable, add screenshots or GIFs to help explain the issue. -->

**Additional Information:**
<!-- Add any additional information that may be helpful in understanding the issue. -->
With these improvements, the bug report template now includes sections for the following information:

Issue Description: A brief description of the bug.
Does this issue occur when all extensions are disabled?: To check if the problem is related to any installed extensions.
VS Code Version: The version of Visual Studio Code you are using.
OS Version: The version of your operating system.
Steps to Reproduce: Detailed steps to reproduce the issue.
Expected Behavior: What you expected to happen.
Actual Behavior: What actually happens.
Screenshots: Optional, for visual representation of the issue.
Additional Information: Any extra details that might help in understanding the problem.
  • Loading branch information
Jvr2022 authored Jul 27, 2023
1 parent 268f349 commit 72e342a
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,32 @@ about: Create a report to help us improve
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes/No

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version:
- OS Version:
**Issue Description:**
<!-- A clear and concise description of what the bug is. -->

Steps to Reproduce:
**Does this issue occur when all extensions are disabled?:**
<!-- Yes/No -->

**VS Code Version:**
<!-- Provide the version of Visual Studio Code you are using (e.g., 1.60.0). -->

**OS Version:**
<!-- Provide the version of your operating system (e.g., Windows 10, macOS Big Sur, Ubuntu 20.04). -->

**Steps to Reproduce:**
<!-- Provide step-by-step instructions to reproduce the issue. -->
1.
2.

**Expected Behavior:**
<!-- A clear and concise description of what you expected to happen. -->

**Actual Behavior:**
<!-- A clear and concise description of what actually happens. -->

**Screenshots**
<!-- If applicable, add screenshots to help explain the issue. -->

**Additional Information:**
<!-- Add any additional information that may be helpful in understanding the issue. -->

0 comments on commit 72e342a

Please sign in to comment.