Carpet

Carpet

2M Downloads

[Scarpet Optimizer] (1/2)/3 returns 6

altrisi opened this issue · 1 comments

commented

Originally posted by @JackRedstonia in gnembon/scarpet#210, recreated it since it's important.

Describe the bug
Evaluation of (1/2)/3 or 1/2/3 in the /script run command returns 6.

To Reproduce
Steps to reproduce the behavior:

1. Ensure `commandScript` is on: `/carpet commandScript ops` or `/carpet commandScript true`

2. Run `/script run 1/2/3` or `/script run (1/2)/3`

3. Receive `6` as the result.

Expected behavior
The command returns a value around 0.166666666667.

Actual Behaviour

script run (1/2)/3 
[16:03:09] [Server thread/INFO]: Input code size for system chat: 5 nodes, 3 deep
[16:03:09] [Server thread/INFO]: Compacted from 5 nodes, 3 code depth to 4 nodes, 2 code depth
[16:03:09] [Server thread/INFO]: Optimized from 4 nodes, 2 code depth to 1 nodes, 1 code depth
[16:03:09] [Server thread/INFO]:  = 6 (523µs)
script run 0.5/3
[16:03:14] [Server thread/INFO]: Input code size for system chat: 3 nodes, 2 deep
[16:03:14] [Server thread/INFO]: Optimized from 3 nodes, 2 code depth to 1 nodes, 1 code depth
[16:03:14] [Server thread/INFO]:  = 0.166666666667 (476µs)

@altrisi

Does it work properly if you disable the scriptsOptimization rule?

@JackRedstonia

@altrisi Indeed. I think this is an issue with the expression optimizer then?

carpet scriptsOptimization false
[16:51:53] [Server thread/INFO]: scriptsOptimization: false, [change permanently?]
script run (1/2)/3
[16:52:00] [Server thread/INFO]:  = 0.166666666667 (3354µs)
commented

lol