Fix remaining preprocess bugs and backport Wave pragma fix#1025
Merged
AnastaZIuk merged 3 commits intomasterfrom Mar 19, 2026
Merged
Fix remaining preprocess bugs and backport Wave pragma fix#1025AnastaZIuk merged 3 commits intomasterfrom
AnastaZIuk merged 3 commits intomasterfrom
Conversation
Point Boost to the exact Wave one-line backport for emitted pragma newlines, remove the temporary local pragma workaround, and keep the remaining include-path fixes in Nabla. This leaves the Wave pragma issue fixed at the dependency level while preserving the Nabla-side fixes for Windows backslash includes and single-leading-slash virtual includes. Thanks to @Themperror for the additional pragma and include repros. Those made it straightforward to verify the dependency-level fix and drop the local workaround cleanly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the remaining preprocess issues without carrying a local
#pragmaworkaround in Nabla.waveandboostsubmodule commits instead of keeping a local placeholder/restore path in Nabla#include "std\\numbers.hlsli"by keeping filesystem lookup on the raw include spelling instead of unescaping string-literal escapes before lookup#include "/systems/rendergraph/common/defines.slang"nsc -P --dump-preprocessed-on-failureflow for partial dumps on failureRoot cause
The
#pragma/ missing#endifissue was not introduced by the recent Nabla preprocess work. Our pinned Wave snapshot was still on the Boost 1.84 line ate02cda69e4d0. Inpp_iterator_functor<ContextT>::on_pragmait emits external pragmas without appending the final newline token, so a minimal input such asturns into
#pragma something#endifand Wave reports a missing#endifat end of file. Upstream fixed that in543a0e9e1d0e, so this PR backports that exact one-line fix through the officialwavecommiteffdd48f2775and the officialboostpointer update79a5d9a5be2dinstead of updating the whole Boost dependency stack.Windows-style backslash includes were a separate Nabla bug introduced by
0c829039cc34inwaveContext.h, where include lookup started to run throughutil::impl::unescape_lit(file_path)before filesystem resolution. That is wrong for filesystem lookup, because spellings such asstd\\numbers.hlsliare not meant to become control characters before the lookup happens.Single-leading-slash virtual includes were another separate Nabla bug introduced by
5ac3b555522cinIShaderCompiler.cpp. A spelling such as/systems/rendergraph/common/defines.slangis treated bystd::filesystemas rooted, which discards the configured search root instead of treating that slash as a virtual include root.The partial-output gap was not an upstream Wave bug. It was a missing failure-path feature in
nsc -P, so this PR keeps the richer diagnostics and threads the already-emitted preprocess text back to-Fcwhen--dump-preprocessed-on-failureis requested.Validation
Local Debug validation in NSC source mode included:
cmake --preset user-configure-dynamic-msvc -DNBL_NSC_MODE=SOURCEcmake --build build/dynamic --config Debug --target nscnsc -Psmoke test for a minimal external#pragmainside a conditional blocknsc -Psmoke test for an external#pragmafollowed by ordinary shader codensc -Psmoke test for a vendor#pragmawith a trailing commentnsc -P --dump-preprocessed-on-failuresmoke test for a real missing#endifcasensc -Psmoke test for a single-leading-slash virtual include with an explicit include search rootnsc -Psmoke test for a Windows-style backslash include spelling with an explicit include search rootThe three pragma repros now pass without any local Nabla workaround and keep
#pragmaon its own line in the preprocessed output. The real missing#endifcase still fails as expected and still writes a partial dump when--dump-preprocessed-on-failureis enabled. The rooted-include and Windows-backslash include repros also pass.Thanks
Thanks to @Themperror for the missing-partial-dump request and for the additional pragma and include repros. Those made it possible to confirm that the pragma issue was really the pinned Wave 1.84 bug and to verify the Nabla-side fixes cleanly.