Repository navigation
[RFC] Program extensions - #1113
ThomasHaas wants to merge 3 commits into
Conversation
A ProgramExtension can capture additional information unique to the frontend program such as an additional spec in the Litmus format.
|
If the only goal is to handle litmus A different perspective would be to just consider all of this a "program spec" rather than a "program extension" and therefore use a less general |
Performance comparisonLinux x64Benchmark detailsMemory model: vmm
Memory model: aarch64
Memory model: power
Total
2 benchmark(s) omitted because both averages were below 5 seconds. macOS ARM64Benchmark detailsMemory model: vmm
Memory model: aarch64
Memory model: power
Total
|
|
What does the "extension" in I like the idea of having a way to attached extra stuff to a program. In this view, the extension would be similar to the metadata but we would allow it to affect semantics. However, I see two problems with the current proposal (assuming the "view" of above):
I see all the following could be extensions in the view above (I am not saying we might really want to implemented them all as this)
2-5 kind of represent the environment where the program executes. 5,6 is probable something we would still want to control from options rather than "mark it" in the source code as we do the others. |
The latter: "something extra".
Yes, that was the idea.
I thought about this too. The issue is that all this verification goal information is inside the program's syntax and as such, the
I think if we can add features that make sense directly on our internal language, we probably do not need a generic extension mechanism. The biggest outlier among those points is really the
|
|
My main issue with the current proposal is its lack of modularity. I think the PR should introduce a mechanism through which a program can carry multiple independent attachments. The common interface could be called Initially, we would add two implementations:
Both attachments would be produced when parsing Litmus and SPIR-V programs. Then, as part of #1086, we could add:
We can then separately discuss whether any of the other information mentioned above (aliases, grid, etc) should also use this mechanism. |
If you fully modularize it like this, I think it will boil down to exactly what we have right now: a single (optional) member per extension (e.g., spec and filter). The only difference is that we would wrap all the members in wrapper classes and maybe use a map to store all attachments.
Then I would just add a |
|
I will close this for now |
This is a quick implementation of an idea I had.
Some program formats like Litmus specify extended information such as filters and specs that go beyond the program itself.
To capture this, I added a
ProgramExtensionmember toProgramwhich can be instantiated to aProgramExtension.Litmusobject containing all the extra information. I also used this for SPIR-V which uses the same filter/spec structure as litmus.As noted in #1086, the litmus format can also specify "locations" for the purpose of enumeration. Supporting this would be straightforward by adding a new member to
ProgramExtension.Litmus.I'm not sure if this is the best way to go about it and if there are any pitfalls, but the idea seems reasonable to me.