Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0006012Dwarf FortressDwarf Mode -- Itemspublic2012-06-12 00:142014-08-07 17:23
ag 
Toady One 
normalmajoralways
resolvedfixed 
0.34.11 
0.40.07 
0006012: Temperature updates for items in containers never stabilize.
Items are supposed to reach the temperature of the environment within reasonably short time, and cease being updated. Instead, the process reaches a boundary 1 temperature unit away from the environment and never progresses further, thus forcing updates to continue forever.

The issue is caused by interaction between update from environment, and update from other items in the container. The container temperature update is done in a vmethod that performs the following steps (assuming environment temp is 10015, and the bin is 10016):

1. Average temperature for all items in bin is computed: 10016
2. Items are updated from environment 10015; the delta amounts to -0:001, moving them to 10015:499.
3. Items are updated from the average 10016; the delta is +0:001, restoring the original temp.
4. Bin is updated from average 10016, reaching 10016.
5. Bin is updated from environment, returning to 10015:499.

(the notation is "temperature:fraction")

The end state is exactly equivalent to the initial, yet the needs update flag is confirmed.
Find a bin with items underground and set all temperatures to 10100. Observe them quickly reach 10016 (assuming environment is 10015) and stop there. The bin itself will stop at 10015:499, or whatever the right fraction for it will be.
My profiling of a few large forts suggests that temperature updates for items are the topmost source of lag there, along with unit temperature updates, unit friend-or-foe checks, and pathfinding; so I think this issue warrants attention.

A similar problem may exist with spatters on items, but I didn't investigate closely.
No tags attached.
Issue History
2012-06-12 00:14agNew Issue
2013-10-25 12:51KercsoIssue Monitored: Kercso
2013-10-27 17:52FootkerchiefIssue Monitored: Toady One
2014-08-07 09:47KirkegaardIssue Monitored: Kirkegaard
2014-08-07 10:104maskwolfIssue Monitored: 4maskwolf
2014-08-07 10:15FootkerchiefAssigned To => Footkerchief
2014-08-07 10:15FootkerchiefStatusnew => confirmed
2014-08-07 15:40Toady OneStatusconfirmed => resolved
2014-08-07 15:40Toady OneFixed in Version => Next Version
2014-08-07 15:40Toady OneResolutionopen => fixed
2014-08-07 15:40Toady OneAssigned ToFootkerchief => Toady One
2014-08-07 15:45KirkegaardIssue End Monitor: Kirkegaard
2014-08-07 17:234maskwolfIssue End Monitor: 4maskwolf

There are no notes attached to this issue.