Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Possible closedness regression in v0.3.0-beta.1 #642

Closed
addreas opened this issue Jan 15, 2021 · 4 comments
Closed

Possible closedness regression in v0.3.0-beta.1 #642

addreas opened this issue Jan 15, 2021 · 4 comments

Comments

@addreas
Copy link

addreas commented Jan 15, 2021

What version of CUE are you using (cue version)?

Git tags v0.3.0-alpha6 and v0.3.0-beta.1, some bisecting points to cea55b2 as the culprit

Does this issue reproduce with the latest release?

Yes

What did you do?

Got it down to this:

test: close({
    a: _
    b: x: _
} & {
    [string]: y: _
})

test: a: x: _
test: b: x: _

What did you expect to see?

For it to type check correctly

What did you see instead?

test.a: field `x` not allowed:
    ./test.cue:1:13
    ./test.cue:5:15
    ./test.cue:8:10
exit status 1

Was easily worked around, and ended up being a lot less convoluted. By the way, a cue vet of my entire repository dropped from 55.5s to 32.1s, great work on the performance improvements! 👍

@mpvl
Copy link
Contributor

mpvl commented Jan 16, 2021

@addreas thanks for the detailed report with small reproducer. That is extremely helpful.

BTW, We would be very interested to investigate repos that take 32.1s. I don't think there should be many repos that take more than 1s or 2s. We reduced several hour-long running configs to less than 1s or 2s, so it could very well be that yours is also is suffering from some yet-to-be-fixed performance bug. We are aware of a few more potential issues, but we tend to prioritize the ones that we know are causing issues for users.

@myitcv is working on a setup where we can validate new versions again external repos that users can register. So maybe waiting for that makes sense, if you're interested for us to take a look.

@mpvl mpvl added this to the v0.3.0-evaluator-rewrite milestone Jan 16, 2021
cueckoo pushed a commit that referenced this issue Jan 16, 2021
Would in some cases recursively close.

Now uses just one method for marking closedness. Marking
Closed in the Vertex was only used so that the debug printer
would show the closed status. This has now fixed. This was
not possible before but is now as the code was recently
simplified.

Fixes #642

Change-Id: I9aab6a02f36ddbc8ed9bce356a2f4ad77cd30cda
@mpvl mpvl closed this as completed in 826bd7b Jan 16, 2021
@addreas
Copy link
Author

addreas commented Jan 17, 2021

Validating against external repos seems like a great idea so I took some time to setup a repository over here that is a bit smaller but seems to show the same performance characteristics. Wouldn't be surprised if you are correct and I'm doing something weird. Always had a feeling that performance would be ironed out at some point, so I never thought too much about it.

Also found another issue while setting that up, but I just saw the beta2 release so perhaps I don't have to. Continually impressed with the development pace of this project 🥇

@myitcv
Copy link
Contributor

myitcv commented Apr 7, 2021

@addreas - just following up on the point about regression testing, unity is now in place and we have a small number of projects in the corpus. It's already helping to smooth out the release process, catching a few important problems before the release of v0.3.0. Details in the README, but of course please feel free to start an issue/discussion if you want to raise anything.

@cueckoo
Copy link

cueckoo commented Jul 3, 2021

This issue has been migrated to cue-lang/cue#642.

For more details about CUE's migration to a new home, please see cue-lang/cue#1078.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants