tweag / nickel

Better configuration for less
https://nickel-lang.org/
MIT License
2.43k stars 93 forks source link

Fix unsound record contract deduplication #2042

Closed yannham closed 2 months ago

yannham commented 2 months ago

Closes #2041.

As hinted in the original issue, the culprit is indeed the contract deduplication optimization, and more specifically the contract equality checker. The checker only looks at the fields' values to establish equality without looking at the metadata, which is obviously wrong, as it would equate most contracts with the same structures such as {foo | Number} and {foo | String}, since the distinction is in the metadata.

This commit fixes the issue by comparing the field metadata as well.

yannham commented 2 months ago

TODO:

github-actions[bot] commented 2 months ago

🐰 Bencher Report

Branch2042/merge
Testbedubuntu-latest

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
fibonacci 10📈 view plot
⚠️ NO THRESHOLD
498,230.00
pidigits 100📈 view plot
⚠️ NO THRESHOLD
3,281,100.00
product 30📈 view plot
⚠️ NO THRESHOLD
820,750.00
scalar 10📈 view plot
⚠️ NO THRESHOLD
1,495,100.00
sum 30📈 view plot
⚠️ NO THRESHOLD
824,090.00
🐰 View full continuous benchmarking report in Bencher