kevinawalsh / logisim-evolution

Digital logic designer and simulator
GNU General Public License v3.0
115 stars 17 forks source link

weird visual glitch with larger circuits [4.0.1] #57

Closed ProxyPlayerHD closed 4 years ago

ProxyPlayerHD commented 4 years ago

usually all components have gray pins when not connected and when using the poke tool you can look at the state of a wire...

well after a certain distance from the top left of the circuit this kinda stops working.

components get black/blue pins (black if pin is wider than 1 bit) and using the poke tool doesn't seem to work anymore. even when the wire is showing a high or low state the poke tool still only shows "X"s but only after a split point in a wire (the split points are always blue on single bit wires)

it's hard to explain, so here a few screenshots. how it's supposed to be:

javaw_2019-12-16_20-19-50

how it looks if far enough away:

javaw_2019-12-16_20-20-00

both right next to eachother.

javaw_2019-12-16_20-20-46

no idea why this is happening, i also tried it on a completely new file and it still happens. so this should be easy to reproduce.

lastly, this is purely visual, the circuits still work as expected.

kevinawalsh commented 4 years ago

Nice catch. This is almost certainly a fault with the "fast path grid" in CircuitState. State for any point within 2000 units of the origin is handled using a dense 2d array. This makes most simulation faster, at the cost of increased memory usage. Anything further away uses a slow path hashtable, trading off speed for reduced memory usage. That code was a quick hack to improve performance, and there must be a regression in the drawing code where the slow path is failing.

kevinawalsh commented 4 years ago

Fixed by c1337692098bb8c90247b49f2263182379d1b202