0.5.2: the island boundary runs on macOS and Windows, and a namespace segment is derived by path arithmetic - #15
Merged
Conversation
`mcpp.tools.island` compiled on all three hosts and had been exercised on one. What it does is path arithmetic -- a namespace is the path from a root to a file -- and a path separator is not the same character everywhere; `force_include_flags` also answers `/FI<path>` as one token for MSVC where every other driver takes `-include <path>` as two, and that branch had no runner either. The fixture needs no accelerator payload: its islands are ordinary C.
…ng surgery The island fixture, run on windows-2022 for the first time, failed to compile with `no member named 'image' in namespace 'island_interface::kernels'`. The same fixture passes on Linux and macOS. `namespace_of` trimmed the base directory off the front of a file's directory as a STRING. On Windows the two spellings differ even when the two paths are the same: a caller states a root with forward slashes, and `directory_iterator` appends with the preferred separator, so the leftover was `\image` rather than `image`. Iterating that yields the root directory as its first component, which the sanitiser turns into `_`, and the entry point landed in `island_interface::kernels::_::image` -- a namespace no consumer writes. `lexically_relative` compares components, so the separator a caller happened to write is not part of the question. A base that is not a prefix now answers with no segments rather than with the whole absolute path. THE SHADER LANE HAD THIS TOO. `namespace_of` is shared by both lanes since 0.5.0, and `rules-spirv`'s Windows fixture keeps every payload in one directory, so a namespace segment was never derived there. The leg that surfaced the defect is not the lane it lives on, and a step now asserts that the derivation exists once so the island fixture's cross-platform run keeps protecting the shader lane.
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.
This began as a coverage step and found a defect.
The coverage that was missing
mcpp.tools.islandcompiled on all three hosts --tests/all-rules-compileimports it -- and had been exercised on one. What it does is path arithmetic: a namespace is the path from a root to a file, and a path separator is not the same character everywhere.What the first run found
windows-2022, the island fixture, failing to compile:
namespace_oftrimmed the base directory off a file's directory as a string. On Windows the two spellings differ even when the paths are the same: a caller states a root with forward slashes,directory_iteratorappends with the preferred separator, so the leftover was\imagerather thanimage. Iterating that yields the root directory as its first component, the sanitiser turns it into_, and the entry point landed inisland_interface::kernels::_::image-- a namespace no consumer writes.lexically_relativecompares components, so the separator a caller happened to write is not part of the question. A base that is not a prefix now answers with no segments rather than with the whole absolute path, which is what the string form produced.The shader lane had this too
namespace_ofis shared by both lanes since 0.5.0, andrules-spirv's Windows fixture keeps every payload in one directory -- so a namespace segment was never derived there. The leg that surfaced the defect is not the lane it lives on.A step now asserts that the derivation exists once, in the lib root: a copy reintroduced in a rule would silently take away the protection the island fixture's cross-platform run gives the shader lane.
Criteria
namespace_oforcommon_base_dirdefined outsidesrc/plugins.cppmnamespace default_, re-run locallyThe floor does not move.