Skip to content

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

Closed
@mvdan

Description

# 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.

Metadata

Assignees

No one assigned

    Labels

    evaluatorevalv3issues affecting only the evaluator version 3evalv3-winIssues resolved by switching from evalv2 to evalv3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions