Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"incomplete value" regression in evalv3 which appears to be order dependent #3638

Open
mvdan opened this issue Dec 30, 2024 · 1 comment
Open
Labels
evaluator evalv3 issues affecting only the evaluator version 3

Comments

@mvdan
Copy link
Member

mvdan commented Dec 30, 2024

# With the old evaluator.
env CUE_EXPERIMENT=evalv3=0
exec cue vet -c

# With the new evaluator.
env CUE_EXPERIMENT=evalv3=1
exec cue vet -c

-- input.cue --
package p

routes: default: {}
routes: [string]: spec: [{
	refs: [{"default"}]
}]
#Fields: {
	input: _
	output: [for x in input { x }]
	...
}
#Kubernetes: {
	#Fields & {
		Routes: route: [_]: spec!: HTTPROUTESPEC.#x
	}
	#Fields // Commenting out this line also fixes evalv3.
	Routes: _
	input: res1: Routes
}
let HTTPROUTESPEC = {
	#x: [...{
		refs: [...{string}]
	}] | *[{
		other: []
	}]
}

// Order dependent! Breaks if the lines below are moved to the top of the file.
entrypoint: used.output
used: #Kubernetes & {
	Routes: route: routes
}

As of 46fc54aa9caf95393dcd3fe0ac066c8112da986d:

# With the old evaluator. (0.010s)
> env CUE_EXPERIMENT=evalv3=0
> exec cue vet -c
# With the new evaluator. (0.030s)
> env CUE_EXPERIMENT=evalv3=1
> exec cue vet -c
[stderr]
used.output.0.route.default.spec: incomplete value [{refs:["default"]}] | [{refs:["default"],other:[]}]
[exit status 1]

See the comments; removing one repetitive definition embedding, or moving the last two fields to the top of the file, both make the error go away. So it seems like there's some rather nasty bug in evalv3 that causes order-dependent or inconsistent evaluation.

@mvdan mvdan added evaluator evalv3 issues affecting only the evaluator version 3 labels Dec 30, 2024
@mvdan
Copy link
Member Author

mvdan commented Dec 30, 2024

Reduced from a failure in Holos as reported by @jeffmccune. Note that #3637 was a spin-off from the example above, but a different bug entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
evaluator evalv3 issues affecting only the evaluator version 3
Projects
None yet
Development

No branches or pull requests

1 participant