Add source metadata to program - #1105
hernanponcedeleon wants to merge 2 commits into
Conversation
9a25200 to
36a4588
Compare
| public Path getInputPath() { | ||
| Preconditions.checkState(hasMetadata(Source.class), "Program has no source metadata"); | ||
| return getMetadata(Source.class).path(); | ||
| } | ||
|
|
There was a problem hiding this comment.
I'm not sure if we should make any metadata mandatory. We can keep it like this for now, but it does feel a bit strange to me.
There was a problem hiding this comment.
But then we should adapt other classes (e.g., OutputGenerator) which right now require this metadata to exists.
There was a problem hiding this comment.
Yes, classes would need adapt. We can also make the input path an explicit field of Program (like you had it in #1102) to signify that is mandatory. We can also have mandatory metadata, but so far we didn't have that.
I think we will need to discuss guidelines for what Metadata should be used for, if it must be optional or can be mandatory, if it is allowed to affect semantics, and so on. At least some basic principles to follow would be useful.
There was a problem hiding this comment.
I think we will need to discuss guidelines for what
Metadatashould be used for, if it must be optional or can be mandatory, if it is allowed to affect semantics, and so on. At least some basic principles to follow would be useful.
Can you draft a PR for this? That PR can also do the restructuring you suggested here (I think having the metadata as an inner class would be the best since otherwise we might forget we have some specific metadata for some class when doing changes to that class).
There was a problem hiding this comment.
I can do the changes I mentioned in #1097. Do you want to use that PR as a discussion platform regarding Metadata? I thought about opening a discussion thread instead.
There was a problem hiding this comment.
Let's have those changes and the documentation on guidelines as a single PR.
We can probably discuss offline about a first draft and during review we see if we need to adapt.
There was a problem hiding this comment.
I'm still not so happy about the helper method here that throws an exception.
Can't we just get the metadata in OutputGenerator (the only user of that data, right? via getMetadata) and if it is absent default to the program's name instead? We could even go further and check if the program has a name and if not default to "unknown".
I would then also change the toSummary method back to use a string instead of a Path so that we can pass the program's name and possibly dummy value.
EDIT: Then you also don't need to invent fake source information in the UI code I think. Setting the name of the program is enough to get the correct output.
Performance comparisonLinux x64Benchmark detailsMemory model: vmm
Memory model: aarch64
Memory model: power
Total
3 benchmark(s) omitted because both averages were below 5 seconds. macOS ARM64Benchmark detailsMemory model: vmm
Memory model: aarch64
Memory model: power
Total
|
36a4588 to
98b1a50
Compare
This contains the changes from #1102 that were unreleaded to the witness generation.