Log for #openttd on 7th February 2019:
Times are UTC Toggle Colours
00:00:07  <Samu> for the client crash, I think the problem is here at network_client.cpp line 1176 and 1174 should be switched
00:01:11  <Samu> CloseConnection makes _networking = false, and when the save occurs, it is already saving with no network
00:01:24  <Samu> there is no instance running on the client, only on the server
00:01:34  <Samu> should save empty
00:01:50  *** supermop_work has joined #openttd
00:01:52  *** tokai|noir has joined #openttd
00:01:52  *** ChanServ sets mode: +v tokai|noir
00:03:45  *** supermop_work_ has joined #openttd
00:06:12  <glx> oh add that to the issue
00:07:01  <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick commented on issue #7188: Both server and client crash, AI related
00:08:44  *** tokai has quit IRC
00:08:49  <Samu> i actually wonder
00:08:53  <Samu> save empty
00:09:03  <Samu> gonna test brb
00:10:57  *** supermop_work has quit IRC
00:11:25  <Samu> weird, there are two emergency saves
00:11:32  <Samu> shouldn't 1 be enough?
00:12:33  <Samu> CloseConnection does an emergency save
00:12:50  <Samu> then another is done after the error message
00:13:08  <Samu> is that the intention?
00:13:09  <glx> I edited your comment to link to the code
00:14:27  <glx> indeed seems there's too much saving
00:15:18  <Samu> even the error message is repeated
00:17:16  <LordAro> make a note of it in the issue
00:17:19  *** Thedarkb1-T60 has quit IRC
00:17:29  <LordAro> it's not directly related, but can probably be fixed easily at the same time
00:17:37  <LordAro> not worth an extra issue
00:19:49  <glx> anything useful must go in the issue :)
00:20:12  *** Thedarkb1-T60 has joined #openttd
00:20:30  <Samu> edited
00:21:27  <LordAro> Samu: please try to write things properly, don't just copy irc logs
00:21:46  <LordAro> there's so much extra crap in that text
00:23:09  <Samu> ok edited
00:24:35  <DorpsGek_II> [OpenTTD/OpenTTD] glx22 commented on issue #7188: Both server and client crash, AI related
00:24:53  <glx> that's the useful info :)
00:27:35  <glx> and maybe other calls should be checked too
00:27:54  <Samu> May 24 2018, it's recen
00:27:55  <Samu> t
00:29:35  <glx> yes it's recent, but rare enough so it was not reported yet
00:36:44  <Samu> no more crash for client
00:36:54  <Samu> this was indeed the problem
00:37:08  <Samu> as for server, gonna investigate now
00:38:30  <DorpsGek_II> [OpenTTD/OpenTTD] nikolas updated pull request #7086: Change #6173: Update SDL driver to use SDL 2.0
00:40:41  *** supermop_work_ has quit IRC
00:40:42  <Samu> company 2 is the exact one i told to reload ai
00:46:18  <Samu> assert(this->suspend < 0);
00:46:25  <Samu> this->suspend is 0
00:46:35  <Samu> 0 < 0 false, and asserts
00:46:56  <Samu> int suspend;                          ///< The amount of ticks to suspend this script before it's allowed to continue.
00:47:31  <Samu> it was never suspended, it's not even started
00:47:43  <Samu> it's right about to start a new one
00:48:22  <Samu> hmm
00:48:54  <Samu> it's trying to execute an out of date DoCommand?
00:49:24  <Samu> the script that was removed before the Reload was probably suspended
00:49:49  <Samu> the script that is about to start is fresh
00:49:54  <Samu> how to solve
01:21:28  <DorpsGek_II> [OpenTTD/OpenTTD] glx22 commented on issue #7188: Both server and client crash, AI related
01:21:38  <glx> that's where to solve
01:23:13  <Samu> heh I figured as much
01:23:20  <Samu> was also eyeing that
01:25:11  <Samu> the company exist
01:25:15  <Samu> the instance exists
01:25:34  <Samu> both company and instance are already post reload
01:25:58  <glx> yes but it then assumes it's the AI that called the command
01:26:24  <Samu> but it wasn't
01:26:41  <glx> and of course it expect it to be suspended and waiting for the Continue() call
01:26:44  <Samu> it was the one pre-reload
01:27:09  *** Wormnest has joined #openttd
01:27:43  <Samu> what kind of test to put there :|
01:29:46  <glx> try adding || !c->ai_instance->is_started
01:31:48  <Samu> it is started
01:32:04  <glx> are you sure ?
01:32:06  <Samu> but let's try
01:32:28  <glx> is_started means fully initialised
01:33:21  <Samu> is_started = true
01:33:40  <Samu> can't access is_started anyway
01:34:00  <glx> ah yes it's private
01:38:45  <Samu> it's protected, not sure if it's the same as private
01:39:07  <glx> not accessible from outside in both case
01:39:56  <Samu> IsSleeping is public
01:40:02  <Samu> bool IsSleeping() { return this->suspend != 0; }
01:40:07  <Samu> gonna try this
01:40:54  <Samu> if (c == NULL || c->ai_instance == NULL || !c->ai_instance->IsSleeping() ) return;
01:41:21  <glx> should prevent the crash I think
01:45:27  *** Thedarkb-X40 has joined #openttd
01:50:52  <Samu> still crash
01:51:39  <Samu> gonna rebuild again just to make sure
01:52:19  *** Thedarkb1-T60 has quit IRC
02:00:54  <Samu> assert(this->suspend < 0);
02:00:57  <Samu> 1 < 0
02:01:09  <Samu> :(
02:01:39  <glx> hmm for network games it should never be >0 IIRC
02:01:58  <Samu> that IsSleeping only checks this->suspend != 0
02:02:27  <glx> yes because for single player suspend is >0 when suspended
02:02:36  <glx> but for network it's <0
02:03:14  <glx>     if (this->suspend   < -1) this->suspend++; // Multiplayer suspend, increase up to -1.
02:03:14  <glx>     if (this->suspend   < 0)  return;          // Multiplayer suspend, wait for Continue().
02:03:14  <glx>     if (--this->suspend > 0)  return;          // Singleplayer suspend, decrease to 0.
02:03:23  <glx> that's how it works
02:03:47  <glx> if it's >0 in network, something is wrong
02:04:22  <Samu> the command was queued 2 ticks away?
02:04:33  <Samu> erm, behind*
02:05:06  <glx> or Continue() has been called when suspend was < -1
02:05:07  <Samu> could 250000 #opcodes be part of it?
02:05:26  <Samu> there can be only too many commands queued, right?
02:05:46  <Samu> just wondering
02:06:08  <glx> no, once your AI did a DoCommand it will be suspended until it get the result
02:07:20  <Samu> but the command is not yet sent
02:07:26  <Samu> it's queued first
02:07:56  <Samu> next tick is executed, unless the queue is full or something that it makes it require 2 ticks?
02:08:05  <Samu> i don't know, just trying to figure out
02:08:05  <glx> script_object.cpp:310 the command is "sent"
02:08:36  <glx> line 342 the script is suspended, and will wait for Continue()
02:12:08  <Samu> delay = 1
02:12:22  <Samu> which should turn to -1
02:12:28  <Samu> according to that line
02:12:48  <glx> yes but that's working correctly
02:13:13  <Samu> seems to be the new instance starting that's setting it to 1?
02:13:24  <glx> the problem is the new AI yes
02:14:08  <Samu> during initialization?
02:14:20  <glx> no on creation it's 0
02:14:45  <Samu> that's strange
02:14:51  <Samu> then what sets it to 1?
02:22:43  <glx> script_instance:192 add assert(!_networking || this->suspend <= 0); same lines 222 and 243
02:25:24  <glx> but I think the AI called Sleep()
02:26:46  <glx> then the command from the old AI returned
02:27:33  <Samu> _networking is undefined :|
02:28:17  *** Wormnest has quit IRC
02:29:16  <glx> add #include "../network/network.h"
02:29:49  <glx> around line 31
02:30:24  <Samu> building
02:30:26  <Samu> testing
02:30:51  <Samu> assertion failed right away
02:30:52  <glx> I think it may assert even before you restart the AI
02:30:57  <Samu> yes
02:31:05  <Samu> game was just starting
02:31:33  <glx> an AI called Sleep() probably
02:31:36  <Samu> line 222
02:32:20  <glx> but that's for constructor and Start
02:32:31  <Samu> this->suspend = 1
02:32:45  <Samu> 1 <= 0
02:32:54  <glx> there's a Sleep(1) in Start() ?
02:33:21  <Samu> how would I know?
02:33:56  <glx> check the AI source
02:34:00  <Samu> oh
02:34:02  <Samu> that
02:34:18  <Samu> heh, i dont even know which ai started, it picked randomly
02:34:49  <Samu> ah
02:34:52  <Samu> OWNER_DEITY
02:34:58  <Samu> the GS started
02:35:22  <glx> yes makes sense the GS use Sleep()
02:35:23  <Samu> i think the GS is NoCarGOal
02:36:10  <Samu> yep, NoCarGoal
02:36:32  <glx> but indeed the only reason suspend can be > 0 is Sleep
02:37:03  <glx> and it's usually ok, except in case the AI is restarted with pending commands
02:37:28  <Samu> 	// Wait for the game to start 	this.Sleep(1);
02:37:32  <Samu> yes, it has a Sleep
02:38:11  <glx> you can remove the asserts and the include
02:39:14  <Samu> done
02:41:14  <glx> I think we need to add IsWaiting()
02:42:25  <glx>     bool IsWaiting() { return this->suspend < 0; } after IsSleeping() in script_instance.hpp
02:42:34  <glx> and use it in CcAI
02:45:24  <glx> we want to care about the command result only if we are waiting for it
02:46:46  <glx> hmm but that could go wrong if we use DoCommand() but receive the previous result
02:49:19  <Samu> can't get an assert anymore
02:49:22  <Samu> hmm
02:49:56  <glx> yes no assert because we check before the call
02:50:47  <Samu> what could go wrong now?
02:51:04  <Samu> receive the result
02:51:31  <Samu> what will it do to the result?
02:51:48  <glx> the old AI called a command, is stopped, the new AI call a command, receive result of old AI call
02:52:39  <Samu> I see
02:52:40  <glx> if the new call happens after the result, no problem because it has been discarded
02:52:54  <glx> but if it happens before
02:53:21  <Samu> it'd be put in a que first
02:53:44  <glx> yes and results are given in order
02:55:34  <Samu> wasn't the command called Sleep?
02:56:03  <glx> no Sleep() is when the AI decides to sleep
02:56:17  <glx> no need to wait for the server in that case
02:56:44  <glx> indeed Continue() just convert the remaining waiting time in sleep time
02:57:50  <glx> so for multiplayer AI stopping is "wrong"
02:58:52  <Samu> would it mean the old AI could cause the new AI sleep for the time determined by the old ai? that's funny
02:59:11  <glx> no
02:59:42  <glx> the old AI can't do anything to the new AI
03:00:44  <glx> except the possible incorrect command result
03:04:07  <glx> but that won't be easy to prevent
03:04:49  *** Thedarkb-X40 has quit IRC
03:07:44  *** Speedy` has quit IRC
03:08:22  *** HerzogDeXtEr has joined #openttd
03:09:00  <Samu> line 681 of script_instance.cpp ?
03:09:09  <Samu> doesn't look that serious
03:09:41  <Samu> important, i mean
03:10:19  <Samu> hmm, it sets a bunch of variables
03:10:26  <glx> yeah probably very low probability to happen
03:11:54  <Samu> ScriptObject::IncreaseDoCommandCosts(result.GetCost());
03:12:01  <Samu> this one may be the serious one
03:12:28  <Samu> if i understand what it do, it will subtract money from the new company?
03:12:41  <glx> but that won't be the place to fix the possible issue
03:13:14  <glx> it's more in AI:Stop() side
03:13:31  <Samu> oh oh, crash
03:13:45  <glx> where ?
03:14:14  <Samu> >	openttd.exe!SQClass::Mark(SQCollectable * * chain) Line 529	C++
03:14:40  <Samu> the only thing in the call stack
03:14:41  <Samu> nothing else
03:14:44  <Samu> 1 line
03:15:32  <Samu> void SQClass::Mark(SQCollectable **chain)
03:16:23  <Samu> Unhandled exception at 0x00007FF63B8C42CF in openttd.exe: 0xC0000005: Access violation writing location 0x000000B8988BFFD0. occurred
03:16:44  <Samu> Exception thrown at 0x00007FF63B8C42CF in openttd.exe: 0xC0000005: Access violation writing location 0x000000B8988BFFD0. occurred
03:16:51  <Samu> meh
03:17:18  <glx> that's the garbage collector
03:19:38  <Samu> what does it do?
03:20:24  <glx> memory cleaning
03:28:19  <glx> and it's initiated in only 2 places AI::GameLoop() and Game::GameLoop()
03:37:16  *** debdog has joined #openttd
03:38:06  *** Gustavo6046 has quit IRC
03:40:39  *** D-HUND has quit IRC
03:51:27  *** HerzogDeXtEr has quit IRC
04:01:49  *** Mahjong1 has joined #openttd
04:02:07  <DorpsGek_II> [OpenTTD/OpenTTD] nikolas opened issue #7189: fluidsynth driver plays music too loudly
04:08:54  *** Mahjong has quit IRC
04:24:33  *** Samu has quit IRC
04:36:46  *** glx has quit IRC
05:46:19  *** keoz has joined #openttd
06:17:28  *** sla_ro|master has joined #openttd
06:24:59  <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7086: Change #6173: Update SDL driver to use SDL 2.0
06:58:43  *** sla_ro|master has quit IRC
07:11:35  *** andythenorth has joined #openttd
07:20:19  *** andythenorth has quit IRC
07:21:07  <peter1138> It was him.
07:21:19  *** keoz has quit IRC
07:24:09  *** Markk has quit IRC
07:27:43  *** andythenorth has joined #openttd
07:30:20  <andythenorth> o/
08:00:06  <Pikka> o/
08:00:23  <peter1138> Yes but no.
08:05:26  <LordAro> seems legit
08:05:33  <andythenorth> well
08:06:09  <andythenorth> \o/ Horse compiled
08:06:13  <andythenorth> it was not compiling
08:07:48  <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7184: Change: Distribute cargo to multiple stations or industries
08:14:09  * andythenorth fixing
08:14:21  <andythenorth> I should just build some default offsets into nml PP
08:14:43  <andythenorth> every newgrf has to piss around with the offsets for every vehicle length
08:14:50  <andythenorth> daft :)
08:15:07  <Eddi|zuHause> provide a default template?
08:17:21  <andythenorth> we should only need the template for 8/8
08:17:30  <andythenorth> the rest is deterministic maths :P
08:18:24  <Pikka> well
08:18:55  <Pikka> if you draw your shortened vehicles at the front of the 8/8 template, they should use the same offsets. Until you want to reverse them, anyway :)
08:19:04  * Pikka bbl
08:19:07  *** Pikka has quit IRC
08:29:12  <andythenorth> hmm
08:29:20  <andythenorth> default tracks are rather too wide for the trains :P
08:30:08  * andythenorth knew this, it's only noticeable when fixing offsets
08:30:33  *** andythenorth has quit IRC
08:34:06  *** supermop_Home has quit IRC
09:01:01  *** andythenorth has joined #openttd
09:02:51  <peter1138> well
09:46:09  *** Sularken has joined #openttd
09:49:02  *** andythenorth has quit IRC
09:50:24  *** andythenorth has joined #openttd
09:51:31  <andythenorth> time for another infosec meeting!
09:52:21  <andythenorth> well
10:05:45  *** andythenorth has quit IRC
10:06:28  <Eddi|zuHause> dunno what's happening, i started TF, and it freezes every few minutes, while paused
10:06:54  <Eddi|zuHause> just scrolling around the map
10:11:08  <Eddi|zuHause> in perf top i get lots of "ttm_mem_evict_first" "native_queued_spin_lock_slowpath" and "mutex_trylock"
10:19:17  <Eddi|zuHause> might be related to this
10:19:24  <Eddi|zuHause> can anyone translate that for me? :p
10:39:19  <peter1138> That is about PCI passthrough to a virtualized hardware.
10:39:54  <peter1138> At least, VT-D is.
10:40:16  *** andythenorth has joined #openttd
10:40:35  <Eddi|zuHause> so, probably not that related
10:40:48  <Eddi|zuHause> or someone put me in a virtual environment and i didn't notice
10:42:41  <Eddi|zuHause> there's also this thing which probably isn't all that related either, but they all talk about radeon graphics
10:51:34  *** Speedy` has joined #openttd
11:15:54  *** sla_ro|master has joined #openttd
11:47:18  <Eddi|zuHause> i'm gonna destroy everything now
11:47:30  *** Eddi|zuHause has quit IRC
11:48:06  <andythenorth> super
11:48:56  *** Eddi|zuHause has joined #openttd
11:49:40  <Eddi|zuHause> hm, this definitely did not work
12:03:41  <peter1138> super duper
12:26:14  *** Zeentch has joined #openttd
12:26:46  *** m3henry has joined #openttd
12:27:12  <Zeentch> Whee finally some OTTD people :D
12:29:21  <Zeentch> I was wondering, who was it that made the NML Highlighting xml file that's available to download, and do you think that that person could make a YAML 1.2 file for the highligting as well? I use Sublime text for all of my coding and i've recently started to get into NewGRF for OTTD and would be a lot easier with highlighting available as well.
12:33:38  <Eddi|zuHause> i feel like we discussed that before
12:34:01  <Zeentch> First time im here so i've not been a part of that discussion, how did it end?
12:34:25  <Sularken> With the Apocalypse.
12:34:40  <Eddi|zuHause>
12:35:37  <Zeentch> @Eddi|zuHause, thank you so much for the link :D
12:38:55  *** Markk has joined #openttd
12:39:15  <andythenorth> someone gonna make me one for BBEdit too? o_O
12:44:01  <Zeentch> can't bbedit use the xml file that is already around?
12:44:24  <andythenorth> dunno :)
12:48:13  <Zeentch> unfortunatly i can't test it since i'm not using a mac so it's kinda hard for me to try out, although i do have a mac mini that i need to sort out so might try it at that point.
13:15:29  *** Samu has joined #openttd
13:16:14  *** Flygon has quit IRC
13:17:11  <Samu> hi
13:19:48  <m3henry> o/
13:19:56  <Zeentch> O.O
13:20:22  *** Mazur has quit IRC
13:22:47  <Samu> lala
13:26:07  <Samu> this site is not safe
13:26:50  <andythenorth> cert expired
13:27:03  <m3henry> not using letsencrypt?
13:28:06  <m3henry> oh no, it is, but no-one automated its renewal
13:34:12  <Samu> * Check if the instance is expecting an answer from a DoCommand.
13:34:16  <Samu> glx
13:34:31  <Samu> oh, he's offline
13:35:12  *** andythenorth has left #openttd
13:37:30  <Samu> is it normal for the garbage collector to crash?
13:37:59  <Samu> I can't reproduce it
13:38:33  <Samu> it's one of those rare crashes that occur from time to time
13:42:09  <peter1138> Is it normal to crash... Hmm!
13:43:04  <Samu> crash once in months
13:43:32  <Samu> if i try to make it crash again, i may not get it in a timely manner
13:48:46  <m3henry> Solution is obvious: Get rid of the GC xD
13:50:11  <peter1138> Just run out memory instead, yes :-)
13:50:54  <milek7> just needs more swap ;d
13:52:02  <Samu> so it ran out of memory?
13:52:09  <Samu> yesterday's night crash?
13:52:24  <peter1138> Who said that?
13:52:28  <Samu> you
13:52:32  <peter1138> No I didn't.
13:52:44  <Samu> hmm, then how does it crash?
13:52:52  <m3henry> You tell us
13:53:08  <peter1138> My comment was in response to "get rid of the GC" :)
13:53:12  <peter1138> Nothing to do with your crash.
13:53:23  <Samu> 03:16:23  <Samu> Unhandled exception at 0x00007FF63B8C42CF in openttd.exe: 0xC0000005: Access violation writing location 0x000000B8988BFFD0. occurred 03:16:44  <Samu> Exception thrown at 0x00007FF63B8C42CF in openttd.exe: 0xC0000005: Access violation writing location 0x000000B8988BFFD0. occurred
13:53:31  <Samu> <Samu> >	openttd.exe!SQClass::Mark(SQCollectable * * chain) Line 529	C++
13:53:48  <peter1138> Didn't glx already run through it with you?
13:53:55  <Samu> yes and no
13:53:57  <peter1138> Or did you forget?
13:54:40  <Samu> it's initiated in only 2 places, that's all he said
13:54:58  <peter1138> There's nothing wrong with the GC.
13:55:05  <m3henry> Have you tried using unique_ptr instead?
13:55:13  <peter1138> It's the last comment on your bug report.
13:55:30  <m3henry> Or perhaps something is dangling
13:55:44  <peter1138> What happens is the AI got replaced, but it tried to call the callback of the previous AI.
13:56:05  <Samu> ah, that's not the garbage collector crash
13:56:23  <peter1138> Why do you say that?
13:56:49  <Samu> it crashes in a different place
13:57:08  <peter1138> That's how garbage collectors work.
13:57:48  <peter1138> They collect garbage (unused objects) periodically, not constantly, therefore it will happen in a different place.
13:57:51  <Samu> it's separate from that report, unless you mean it's related
13:58:06  <peter1138> It's very likely related, yes.
13:58:20  <Samu>  i didn't force a reload ai, it just happened by itself when i was just watching
13:58:31  <peter1138> Could still happen if an AI dies and then another starts up.
13:58:48  <peter1138> I imagine it's "new" because previously AIs would not start immediately, now they can.
13:59:34  <peter1138> CcAI needs to check that the current AI instance is the same AI instance.
14:01:27  <Samu> the reload ai button was there since ever
14:01:47  <Samu> i doubt it's due to them starting immediately
14:02:02  <Samu> let me try crash in 1.8.0
14:02:05  <Samu> brb
14:04:53  *** octernion has joined #openttd
14:04:54  <Samu> funny, can't make it crash
14:06:56  <peter1138> 13:58 <@peter1138> I imagine it's "new" because previously AIs would not start immediately, now they can.
14:07:07  <peter1138> But you know...
14:07:12  <peter1138> Feel free to ignore me :-)
14:07:26  <Samu> but how come?
14:09:04  <peter1138> ...
14:09:12  <peter1138>
14:09:14  <peter1138> ^^
14:09:59  <peter1138> Welcome to "unintended consequences".
14:10:02  <Samu> i know that, but still I don't get how it could be related. Reload AI button is per config slot
14:10:13  <peter1138> AIs can go bankrupt as well.
14:10:20  <peter1138> Then they are replaced, by themselves.
14:10:28  <peter1138> Well, not by themselves.
14:10:40  <Samu> have you seen what Reload AI does?
14:11:55  <peter1138> It kills off the AI, and then starts a new one. So?
14:12:59  <Samu> this is really strange for me, I can't see why it's related
14:13:14  <Samu> gonna test before 7151
14:13:50  <peter1138> Just pressing reload by itself won't cause an issue.
14:14:15  <peter1138> It's if you press reload just as the AI issued a command and would be expecting an answer for.
14:14:56  <peter1138> after 7151, this could also happen if start_date = 0 and a company goes bankrupt while issuing a command.
14:15:10  <peter1138> Which is how it could happen without pressing Reload AI.
14:18:00  *** Eddi|zuHause has quit IRC
14:18:18  <Samu> aha, got a crash before 7151
14:18:27  <Samu> well what now?
14:19:04  <peter1138> By pressing reload?
14:19:10  <Samu> yes
14:19:16  <peter1138> So still the same issue.
14:19:22  <peter1138> Likely.
14:19:35  <Samu> I rolled back to
14:20:00  <Samu> Commit fa53abe8
14:20:05  <peter1138> Don't focus on 7151, I only mentioned that as a reason why the issue could occur without pressing Reload ID.
14:20:19  <peter1138> I didn't mention it to blame it for causing the crash.
14:20:21  <Samu> but i can't make it happen on 1.8.0
14:20:33  <Samu> something between 1.8.0 and fa53abe8
14:21:59  <Samu> very strange, i'm trying the same steps in 1.8.0, no crash
14:23:08  <Samu> no matter how much I try, no crash, gonna give up
14:24:04  *** Eddi|zuHause has joined #openttd
14:29:05  <Samu> testing Commit 4703cd43
14:29:11  <Samu> wondering if it's AI Config related
14:29:22  <Samu> im always restarting random ais
14:30:28  <Samu> ah snap, can't build
14:30:40  <Samu> requires png library all the old library stuff
14:33:57  <Samu> i can use revert commit, i guess
14:34:08  <Samu> building
14:36:29  <Samu> nop, crash
14:36:44  <Samu> it's not that either
14:38:24  <Samu> what else could it be
14:38:40  <Samu> stuff that handles ticks?
14:43:21  *** Eddi|zuHause has quit IRC
14:43:48  *** Eddi|zuHause has joined #openttd
14:45:49  <planetmaker> can we have slightly bit of a live feed for each command executed on your console?
14:45:58  <planetmaker> +less
14:47:42  *** nielsm has joined #openttd
14:51:53  <LordAro> planetmaker: people have tried in vain for quite a while to make Samu less verbose
14:52:57  <Samu> :|
14:56:01  <Samu> i give up
14:56:15  <Samu> the issue is not originated by 7151
15:03:48  <Samu> glx provided fix, prevents the crash on the reload ai, but.. doesn't totally solve the problem from what I can gather, still gonna PR
15:05:04  *** keoz has joined #openttd
15:05:26  <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick opened pull request #7190: Fix #7188: AI instance crash when reloading AI in a server, and an AI…
15:10:12  <peter1138> Samu, nobody said the issue originated in 7151
15:17:44  *** supermop_work has joined #openttd
15:18:18  <supermop_work> yo
15:18:44  *** Zeentch has quit IRC
15:19:04  *** supermop_work_ has joined #openttd
15:19:57  <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7190: Fix #7188: AI instance crash when reloading AI in a server, and an AI…
15:23:07  *** octernion has quit IRC
15:26:22  *** supermop_work has quit IRC
15:27:12  <Samu> is there a unique identifier for instances?
15:27:21  <Samu> start date, start tick, something
15:29:57  <peter1138> I think it needs a network protocol change :/
15:31:20  *** octernion has joined #openttd
15:31:26  <peter1138> Well, probably not, I'm not really thinking about it at the moment.
15:33:34  <Samu> looking at garbage collector dude, for(SQUnsignedInteger i = 0; i < _stack.size(); i++) SQSharedState::MarkObject(_stack[i], chain);
15:33:40  <Samu> stack size = 1024, allocated = 1024
15:33:42  <Samu> it's full?
15:34:29  <Samu> meh, forget it
15:34:44  <peter1138> Yes, don't bother looking at the garbage collector.
15:36:00  <Samu> uhm, okay, but it crashed :|
15:36:02  <Samu> yesterday
15:36:13  <Samu> I know, it could be related to this reload ai stuff
15:36:40  <Samu> forget
15:36:52  <peter1138> The GC crashed because it was given bad information.
15:37:01  <peter1138> There's no issue with the GC itself.
15:37:43  <Samu> gonna try make garbage collector run every tick
15:37:56  <Samu> maybe i can find a way to crash it
15:40:55  <peter1138> You can crash it by giving it bad data.
15:41:59  <Samu> dont know which data was given, didn't pay much attention :(
15:42:16  <Samu> it was something in **chain
15:43:07  <peter1138> Seriously Samu, don't bother wasting your time on it.
15:43:42  <Samu> "access violation writting to "
15:43:49  <Samu> doing the MARK
15:44:15  <Samu> vms->Mark(&tchain);
15:44:44  <Samu> void SQVM::Mark(SQCollectable **chain) {
15:44:56  <Samu> crashed at the '{'
15:45:03  <Samu> which is a weird place for a crash
15:45:52  <Samu> as for what data it contained, I really have no idea
15:45:55  <DorpsGek_II> [OpenTTD/OpenTTD] nikolas commented on pull request #7086: Change #6173: Update SDL driver to use SDL 2.0
15:48:17  <nielsm> yeah seriously, don't attempt to debug a virtual machine for a relatively complex language like squirrel, if you couldn't design and implement it yourself from the ground up
15:48:39  *** Wormnest has joined #openttd
15:49:10  <peter1138> Samu, it probably contained data about an AI instance that is no longer valid.
15:51:05  <Samu> that's why i'm forcing garbage collection every tick
15:51:13  <Samu> to see if i can reproduce it
15:51:37  <Samu> smashing that reload ai button
15:52:07  <peter1138> Cause and effect.
15:55:58  <Samu> can't trigger any crash
15:56:01  <Samu> oh well
15:56:06  <Samu> time to give up
15:56:23  <peter1138> Write an AI that sends a network command and expects a callback every tick.
15:57:29  <Samu> i wonder if it simply ran out of memory
15:57:30  <nielsm> if you can't trigger it repeatedly then it's likely related to memory layout or timing and likely a use-after-free bug
15:58:30  <nielsm> trigger it reliably *
15:58:33  <nielsm> (not repeatedly)
15:58:54  <Samu> hmm, gonna try the opposite
15:59:15  <Samu> instead of every tick, gonna try every year or so
16:01:47  <Samu> if ((AI::frame_counter & (DAY_TICKS * DAYS_IN_YEAR) == 0)) {
16:02:12  <nielsm> that looks strange
16:03:33  <Samu> oh right, the parenthesis in the bad place
16:03:42  <Samu> if ((AI::frame_counter & (DAY_TICKS * DAYS_IN_YEAR)) == 0) {
16:04:12  <nielsm> unless DAY_TICKS * DAYS_IN_YEAR happens to be a nice bitmask like 0x0FFF that's just a bad way of writing "once in a random while"
16:04:57  <Samu> it was & 255 originally
16:05:21  <nielsm> yes that's a nice bitmask
16:05:57  <nielsm> that works for triggering the condition every time the low byte is zero
16:06:02  <nielsm> i.e. once every 256 frames
16:06:45  <Samu> ah, I'm doing it wrong then
16:08:06  <nielsm> 74*365 == 27010 in decimal, or ‭0110100110000010‬ in binary
16:08:47  <Samu> 32767
16:08:52  <Samu> gonna use this
16:09:02  <nielsm> that would work
16:09:16  <nielsm> 0x7FFF
16:09:47  <Samu> alright, afk 30 min
16:09:55  <Samu> server running, waiting for a crash
16:13:09  *** Gabda has joined #openttd
16:18:08  *** HerzogDeXtEr has joined #openttd
16:19:06  <DorpsGek_II> [OpenTTD/OpenTTD] glx22 commented on pull request #7190: Fix #7188: AI instance crash when reloading AI in a server, and an AI…
16:24:25  *** glx has joined #openttd
16:24:25  *** ChanServ sets mode: +v glx
16:24:46  <DorpsGek_II> [OpenTTD/OpenTTD] Gabda87 opened pull request #7191: Add #5654: Initializing graph GUI
16:26:00  <Gabda> hi!
16:27:15  <Gabda> does this count as issue necroing?
16:29:55  <glx> well if the issue is not fixed I guess it's ok
16:33:03  <nielsm> it's not like a closed issue means "this must never be fixed"
16:34:13  <Eddi|zuHause> especially not if it's a "andy closed this in a cleanup spree" ticket
16:34:38  <glx> same for stale bot closed issues
16:35:22  <Samu> no crashing yet
16:35:40  <nielsm> only if the discussion in the ticket leads up to a "this is definitely not a bug, actually intended" conclusion :)
16:36:04  *** synchris has joined #openttd
16:37:54  <Gabda> ok :)
16:39:30  <Samu> can't get any kind of crash, just reloaded ais and yet nothing
16:39:36  <Samu> oh well, time to give up?
16:43:29  <Samu> it's still july 1950, there was no time for any garbage collection call yet
16:44:59  <Samu> @calc 32767 / 74
16:44:59  <DorpsGek> Samu: 442.797297297
16:45:53  <Samu> @calc 443 / 30
16:45:54  <DorpsGek> Samu: 14.7666666667
16:46:06  <Samu> 15 months
16:50:10  <Samu> why isn't garbage collection called every tick?
16:50:14  <Samu> just wondering
16:50:46  <nielsm> because it tends to take a long time and the value of calling it too often is generally low
16:50:59  <glx> because it's useless to call it more often
16:51:42  <glx> it's called every 255 ticks, but only for 1 AI at a time I think
16:52:12  <nielsm> every 256 ai frames
16:52:23  <nielsm> ai frames may not be every tick, depending on difficulty setting
16:52:38  <glx> true
16:52:59  <nielsm> and the counter for ai frames begins when an ai is started, so every ai will have its gc cycle offset
16:53:43  <glx> I think the crash you got was just a bad luck when pressing restart
16:54:34  <Samu> it wasn't a restart, it was a thing on its own
16:55:13  * glx is trying to see if we can use args of the callbacks to check if it was our command
16:56:54  <glx> like on call the AI store cmd, tile, p1 and p2, then compare that when the callback happens
16:59:33  <Samu> studying the results originated from CompanyID cid = (CompanyID)GB(AI::frame_counter, 8, 4);
16:59:45  <Samu> first cid was 1
17:00:05  <Samu> shouldn't it be 0?
17:00:17  <Samu> gonna keep looking at it
17:00:27  <nielsm> ...what, why should the AI frame counter determine a company id?
17:00:31  *** Gustavo6046 has joined #openttd
17:01:03  <glx> it's just so we don't GC all AI at the same time
17:01:36  <glx> AI:frame_counter is shared with all AIs
17:02:02  <Samu> 256: cid = 1; 512: cid = 2; 768: cid = 3
17:02:07  <Samu> hmm
17:02:40  <nielsm> yes, that's how numbers work
17:03:03  <glx> and the modulo is 255
17:04:13  <glx> ah no it's not a modulo
17:05:02  <glx> but similar
17:06:53  <nielsm>  <- how numbers work
17:07:37  <Samu> i wonder what happens when it gets to 14
17:08:03  <nielsm> I'm sure the code will tell you
17:09:10  <glx> the code checks it's a valid AI id so nothing bad happens
17:09:25  <Samu> what about cid = 0 ?
17:09:37  <Samu> forgotten?
17:09:39  <glx> no
17:09:52  <glx> you forgot 0
17:10:21  <Samu> first frame was already = 1
17:10:25  <Samu> didn't start from 0
17:10:38  <nielsm> happens at frame 0x0000, 0x1000, 0x2000, etc
17:10:40  <glx> yes but cid will be 0 after 15
17:11:17  <glx> 4 bits go from 0 to 15
17:11:26  <glx> and restart
17:11:53  <Samu> aha, 0
17:11:56  <Samu> :)
17:12:34  <Samu> 15 is not a valid cid though, just pauses a bit longer
17:13:36  *** octernion has quit IRC
17:14:11  <Samu> if (((AI::frame_counter - 1)& 255) == 0) {
17:14:17  <Samu> maybe this? or not necessary?
17:14:24  <nielsm> makes no difference
17:14:29  <Samu> just so it would start at cid = 0
17:14:33  <nielsm> just runs it one frame earlier than it usually would
17:14:41  <nielsm> no
17:14:47  <nielsm> also why do you think this is a problem?
17:15:08  <Samu> not a problem, but hmm... nevermind, not a problem
17:15:45  <glx> and basically in single player 0 is not an AI anyway ;)
17:15:50  <nielsm> if you want to know when it runs GC, add in a DEBUG() line
17:16:09  <nielsm> if you want to force a gc cycle to run, hack in a console command to force one
17:18:41  <nielsm> and also keep in mind that squirrel itself will probably run a gc cycle on its own after a while
17:19:08  <nielsm> because that's what garbage collected languages like it do
17:21:11  *** supermop_work_ has quit IRC
17:26:37  *** octernion has joined #openttd
17:35:32  *** Progman has joined #openttd
17:35:32  <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick updated pull request #7190: Fix #7188: AI instance crash when reloading AI in a server, and an AI…
17:38:56  *** Wormnest has quit IRC
17:41:30  <peter1138> I return.
17:43:22  <Samu> hi
17:43:30  <Samu> i need cargo_index
17:43:44  <Samu> can't split the function into 2 like you did
17:44:50  <Samu> or maybe i can
17:45:02  <Samu> will split a bit less
17:45:13  *** m3henry has quit IRC
17:45:38  <peter1138> glx, with the callbacks, it may be sufficient to check it at the command-level, based on company, rather than delving into the AI?
17:47:11  <glx> when the AI is restarted company is deleted and a new one is created
17:48:27  <glx> the commands know nothing about companies, only the index
17:48:34  <glx> I think
17:50:17  <peter1138> Yup, but you can say the same about the AI instance side, too.
17:50:23  <glx> for now I added cmd as callback args
17:50:59  <glx> so I need to store command args when the script calls and check that when handling the callback
17:51:17  <peter1138> But really it shouldn't be getting to the callback.
17:51:46  <glx> once the command is queued I don't know if we can do something
17:51:50  <peter1138> Hmm, I supose it depends if it's the same company but different AI instance, or different company.
17:52:11  <peter1138> I think a command from a company that got removed and then added as new should not get executed.
17:52:33  <glx> hard to check I think
17:52:54  <peter1138> I can think of a way but it'd be intrusive to the network protocol.
17:53:22  <peter1138> Not that it matters too much :)
17:53:35  <glx> at least the callback can do some safety checks to be sure it was its command
17:54:50  <Samu> give instance a unique name or so
17:55:13  <Samu> then compare the name ?
17:55:30  <peter1138> No
17:55:51  <peter1138> Map company ID to a unique ID within NetworkSendCommand
17:55:59  <peter1138> Then map it back on the recieving end.
17:56:07  <peter1138> If there is not mapping, reject it.
17:56:24  <peter1138> Actually it could still work with a byte value which is just incremented for each new company.
17:56:43  <peter1138> Then a new company with the same company->index would be a different unique ID
17:57:52  *** Eddi|zuHause has quit IRC
17:58:10  <glx> hmm should also work if a company is merged while sending a command and a new company is then created in the same slot
17:58:29  <glx> (very rare case but possible I guess)
17:58:33  <peter1138> *nod*
17:59:21  <glx> especially if the server is very slow
18:01:48  *** Eddi|zuHause has joined #openttd
18:19:08  *** Wolf01 has joined #openttd
18:19:14  <Wolf01> o/
18:28:02  *** m3henry has joined #openttd
18:32:07  <DorpsGek_II> [OpenTTD/OpenTTD] Gabda87 opened pull request #7192: Change: making the style of MakeVoid calls uniform
18:33:13  <Gabda> is this kind of change is welcomed?
18:33:28  <Gabda> or I shouldn't bother if I see something like this?
18:34:16  <Gabda> (you can drop one "is" from my first question)
18:34:34  <peter1138> "y < MapMaxY()"
18:34:42  <peter1138> That means the function will be called for every iteration of the loop
18:34:53  <peter1138> Best not to make that change.
18:35:58  <peter1138> Although I see it's done elsewhere, so who knows :p
18:36:14  <Gabda> yes, I also saw it elsewhere
18:36:24  <Gabda> and I think the compiler optimizes it
18:36:26  <m3henry> Without -flto that call wouldn't be optimized too
18:36:31  <Gabda> but makes it more readable
18:37:01  <peter1138> m3henry, well it's inline
18:37:08  <Gabda> hmm, so the compiler does not optimize it by default?
18:37:09  <peter1138> static inline I mean.
18:37:41  <m3henry> oh It is in the same TU
18:37:44  <peter1138> Gabda, probably but...
18:38:01  <m3henry> Well then the compiler would be free to optimize it away if it things there's no aliasing
18:38:05  <m3henry> thinks
18:38:12  <peter1138> Gabda, even if the function is optimized away, it could still be the difference between a register compare and a memory compare.
18:38:42  <peter1138> Hmm
18:38:45  <m3henry> I would just store the value in a const variable
18:38:58  <m3henry> Then I don't need to care if the operation is expensive
18:39:45  <peter1138> glx, hmm, trying to work out how to synchronize my unique on new company creation.
18:39:52  <peter1138> *unique id.
18:39:57  *** gelignite has joined #openttd
18:40:15  <Gabda> I think it also can be a readability vs optimizing question
18:40:18  <peter1138> Oh, NetworkServerNewCompany, perhaps.
18:41:04  <m3henry> I would say that storing the value before entering the loop is more readable, because I know that the value does not change
18:41:13  <Gabda> the first gets better a little, the latter might be a little worse
18:41:29  <Gabda> I see
18:42:12  *** andythenorth has joined #openttd
18:42:16  <m3henry> int const maxX =  MapMaxX(); is easy to understand the effect
18:42:32  <andythenorth> yo
18:42:35  <m3henry> 'lo
18:42:39  <peter1138> I think we prefer const int :-)
18:42:54  <peter1138> norththeandy
18:43:31  <Gabda> ok, I'll rewrite them
18:43:44  <m3henry> I recently found out that if you read variable declarations backwards, then it reads as it would in english
18:44:03  <Gabda> my main concern was to make them uniform
18:44:12  <m3henry> So west-const became my standard
18:44:34  <Gabda> I do not insist any of the particular style
18:45:59  <m3henry> It can't work for function pointer declarations or array declarations
18:46:15  <m3henry> But it's better than nothing
18:51:21  <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick updated pull request #7184: Change: Distribute cargo to multiple stations or industries
18:54:53  <glx> <-- untested but it compiles fine :)
18:57:40  <andythenorth> one day a faster nml
18:58:10  <andythenorth> how about multi-grfs?
18:58:23  <andythenorth> appears as one grf to openttd, but is actually multiple grf files?
18:58:57  <peter1138> What
18:59:09  <peter1138> #include :/
18:59:17  <andythenorth> o_O
18:59:38  <andythenorth> then I could compile, e.g. one grf per vehicle
18:59:50  <DorpsGek_II> [OpenTTD/OpenTTD] Gabda87 updated pull request #7192: Change: making the style of MakeVoid calls uniform
19:00:03  <andythenorth> which would be, perhaps 20x faster when a single vehicle changes out of 200
19:00:10  <andythenorth> I'm allowing an order of magnitude for overhead
19:01:03  <Gabda> I inserted your suggestions
19:01:51  *** supermop_work has joined #openttd
19:02:58  *** frosch123 has joined #openttd
19:03:11  *** supermop_work_ has joined #openttd
19:04:32  *** octernio_ has joined #openttd
19:06:46  <supermop_work_> yo
19:06:53  *** octernion has quit IRC
19:07:54  <Gabda> in case something like this: is it possible to restart the check, or I have to push a new version of the commits?
19:09:14  <nielsm> there is a restart button some people can push
19:09:53  *** supermop_work has quit IRC
19:10:20  <nielsm> there
19:11:00  <nielsm> ...maybe
19:12:31  *** Thedarkb-T60 has joined #openttd
19:15:22  <peter1138> Hmm, so client send command, server executes command, and then I guess sends it back to all the clients, right?
19:15:53  <nielsm> server validates command can execute, then executes it itself and tells everyone else to do the same thing at that tick
19:16:02  <nielsm> as far as I understand
19:22:33  *** debdog has quit IRC
19:22:42  <Gabda> nielsm: thanks
19:23:04  <andythenorth> ha ha
19:23:13  <andythenorth> I cut Horse compile time from 1 minute to 15 seconds
19:23:16  <andythenorth> much better
19:23:36  <nielsm> by doing something dumb and in retrospect obvious?
19:23:43  <andythenorth> yes
19:23:50  <andythenorth> I deleted 200 of the vehicles
19:23:55  <andythenorth> much faster now
19:23:55  <supermop_work_> HA
19:24:16  <peter1138> o_O
19:24:25  <andythenorth> I think I might rework it to be a minimal set, like Pikka's
19:24:31  <andythenorth> I bored of waiting for compiles
19:24:44  <andythenorth> 10 engines, 10 wagons
19:25:12  <andythenorth> or I do separate grfs
19:26:11  <andythenorth> 24 grfs
19:26:18  <andythenorth> Iron-Horse-Engines.grf
19:26:27  <andythenorth> Iron-Horse-Brake-Vans.grf
19:26:28  <andythenorth> etc
19:29:20  <peter1138> Why is it so slow?
19:29:38  <Samu> the fix I got partially fixes the issue
19:30:04  <andythenorth> script musa to upload them all
19:30:11  <andythenorth> peter1138: it's slow for multiple reasons
19:30:13  <Samu> this is the part I was unable to fix "It als shows that the latest version of the AI has been loaded instead but it didn't receive the savegame data because it's incompatible even though min version to load is 1"
19:30:17  <andythenorth> it's python
19:30:46  <andythenorth> it has some kind of massive ID resolution phase, for action 2 IDs etc
19:31:17  <andythenorth> it's single threaded
19:31:21  <andythenorth> there's no partial compiling
19:31:25  <andythenorth> it does have caches
19:32:38  <Samu> help me think. I save my AI which is version 7 but has a min load version of 2
19:32:54  <Samu> if I load it on a computer that only has version 6 of the AI
19:32:58  <Samu> what will happen?
19:33:26  <Samu> doesn't load the data, because it was saved as version 7?
19:33:41  <Samu> loads the data, because the min load version is 2?
19:35:11  <andythenorth> Horse makefile sample run time is 52s, of that 47s is spent in nmlc
19:35:33  <andythenorth> to compile 270 trains with a crapload of varaction 2
19:36:47  *** Thedarkb-T60 has quit IRC
19:37:25  <andythenorth> if I decompile/recompile the grf with grfcodec, the encode is 2 seconds
19:38:26  <andythenorth>
19:44:26  *** Thedarkb-T60 has joined #openttd
19:50:40  <peter1138> Nice, got a crash on Reload AI...
19:50:53  <Samu> cg!
19:51:38  <Samu> who's a savegame versioning expert?
19:53:46  *** Gabda has quit IRC
19:54:24  <peter1138> Hmm.
19:58:30  <LordAro> @topic get 3
19:58:30  <DorpsGek> LordAro: Don't ask to ask, just ask
19:58:31  <LordAro> Samu: ^
19:58:49  <andythenorth> how will he know who to highlight otherwise :P
19:59:02  <andythenorth> Samu: broadly speaking, there are no experts
19:59:15  <peter1138> So I've queued up a command for a company that no longer exists.
19:59:31  <peter1138> Which means my code is on the right track, BUT, i'm doing the company -> unique_id mapping too late.
19:59:33  <LordAro> that seems inconvenient
20:01:53  *** Gja has joined #openttd
20:03:32  <peter1138> I could try checking that the company exists but that kinda defeats the point of the mapping.
20:04:13  *** debdog has joined #openttd
20:06:20  *** Gja has quit IRC
20:14:13  <DorpsGek_II> [OpenTTD/OpenTTD] LordAro requested changes for pull request #7192: Change: making the style of MakeVoid calls uniform
20:16:57  <DorpsGek_II> [OpenTTD/OpenTTD] LordAro approved pull request #7191: Add #5654: Initializing graph GUI
20:17:34  <DorpsGek_II> [OpenTTD/OpenTTD] LordAro merged pull request #7191: Add #5654: Initializing graph GUI
20:28:10  <DorpsGek_II> [OpenTTD/OpenTTD] LordAro updated pull request #7170: Update: Changelog
20:28:16  <LordAro> arbitrary reminder for someone to review ^
20:28:26  <LordAro> i've bumped the date to sunday now :p
20:28:58  *** synchris has quit IRC
20:29:47  *** cHawk has quit IRC
20:30:51  <peter1138> Hi
20:37:10  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh approved pull request #7170: Update: Changelog
20:40:24  <DorpsGek_II> [OpenTTD/OpenTTD] nikolas commented on pull request #7170: Update: Changelog
20:41:11  <DorpsGek_II> [OpenTTD/OpenTTD] Gabda87 commented on pull request #7192: Change: making the style of MakeVoid calls uniform
20:41:25  *** Gabda has joined #openttd
20:42:09  <LordAro> Gabda: yeah, like the old commit :)
20:43:18  <Gabda> ok :)
20:45:11  <Gabda> peter1138 and m3henry suggested that adding the variable might be a good idea, so I created a new version
20:45:28  <LordAro> hrm
20:45:53  <LordAro> peter1138: ^ thoughts on #7192?
20:45:54  <Gabda> but as there are different preferences, maybe you should talk about it
20:46:23  <Samu> a version 7 with a min version of 2 can't load on a version 6
20:46:53  <Samu> must understand why
20:47:33  <peter1138> I'd imagine because 7 > 6;
20:47:34  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh updated pull request #6965: Add: Option for population-linear town cargo generation
20:48:15  <peter1138> LordAro, I didn't specifically request const, but I did say putting the function call inside the for () condition was maybe not so good.
20:48:30  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on pull request #6965: Add: Option for population-linear town cargo generation
20:48:49  <peter1138> But, I dunno.
20:51:11  * LordAro sees what godbolt says
20:52:01  *** cHawk has joined #openttd
20:55:29  <LordAro> -O2 optimises away very nicely
20:55:43  <LordAro> as does -O1, in fact
20:58:49  <Gabda> oh, it is a nice tool
20:59:09  <nielsm> modern compilers are pretty good at simplifying expressions also involving many layers of (inline) functions and more
21:00:19  <peter1138> So it already loads it into a local variable.
21:00:22  <peter1138> Er, register, I mean.
21:02:12  <peter1138> I like that when MakeVoid is a NOP it's just... nothign :p
21:03:48  <peter1138> Gabda, so apologies, I was talking bollocks :p
21:04:32  <Gabda> no problem, it wasn't much work, and we learned something in return :)
21:05:37  <Gabda> I'll push the first commit back tomorrow (with the changed commit msg), but I have to go now
21:05:42  <Gabda> bye everyone!
21:05:48  *** Gabda has quit IRC
21:06:18  *** Progman has quit IRC
21:06:41  <nielsm> okay, I just looked ath that BitpackedUint template thing I wrote the other day again
21:06:51  <nielsm> both gcc and clang optimize it nicely
21:06:55  <nielsm> microsoft less so
21:07:08  <nielsm> in fact it's pretty terrible
21:07:46  <peter1138> Oh
21:08:49  <peter1138> MSVC is pretty terrible for LordAro's example too.
21:09:38  <LordAro> it's not great, it has to be said
21:09:45  *** octernion has joined #openttd
21:09:51  <LordAro> even when adding /Ob /Og
21:10:26  <peter1138> Seems to be ignoring all the inlines, as it's allowed.
21:10:53  <nielsm>
21:11:20  <LordAro> even adding __forceinline does nothing
21:11:50  *** sla_ro|master has quit IRC
21:11:57  <LordAro> wait hang on, is it just that it's not optimising the functions away, so it looks bigger?
21:12:42  <nielsm> yeah in your example it's leaving in the functions
21:12:46  *** octernio_ has quit IRC
21:12:50  <nielsm> but optimizing the actual main()
21:13:05  <LordAro> looks like the loop is still there though
21:13:24  <LordAro> wait, of course it is
21:13:45  <LordAro> yeah, looks much the same as gcc
21:17:33  <peter1138> clang goes weird.
21:18:22  <LordAro> oh, that's weird
21:18:27  <LordAro> has it tried to unroll the loop?
21:19:13  <LordAro> no, something to do with the volatile variable
21:19:41  <LordAro> if i change it to an extern variable, it behaves much better
21:29:09  <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick opened pull request #7193: Fix #6468: Load correct version of AI as specified during the time of its save.
21:29:24  <Samu> inb4 rejected
21:31:01  *** gelignite has quit IRC
21:33:13  <andythenorth> bananas cert outdated?
21:33:23  <LordAro> uh oh
21:33:49  <LordAro> no? doesn't have https
21:34:34  <LordAro> wait, yes it does, chrome is hiding it from me
21:34:41  <m3henry> Is there pointer aliasing going on?
21:39:08  <dwfreed> andythenorth: "Not Valid After: Wednesday, November 27, 2019 at 18:59:59 Eastern Standard Time"
21:39:17  <dwfreed> cert is valid for *
21:56:31  <DorpsGek_II> [OpenTTD/OpenTTD] LordAro dismissed a review for pull request #7170: Update: Changelog
21:56:32  <DorpsGek_II> [OpenTTD/OpenTTD] LordAro updated pull request #7170: Update: Changelog
21:57:19  *** nielsm has quit IRC
21:59:30  *** octernion has quit IRC
22:00:15  *** frosch123 has quit IRC
22:01:48  *** octernion has joined #openttd
22:03:37  <peter1138> White stilton with mango and ginger.
22:03:42  <peter1138> Not really proper cheese, is it?
22:03:52  <LordAro> bit poncy
22:04:29  <peter1138>
22:04:36  <peter1138> Oh... there were some builds, apparently.
22:05:14  <peter1138> We should just go with it an add NRT for 1.9 :p
22:05:34  <peter1138> Then a week later release 1.9.1 with some of the bugs fixed.
22:05:39  <andythenorth> :P
22:05:46  <LordAro> :o
22:05:51  <andythenorth> loads of builds
22:05:54  <andythenorth> loads of grfs
22:05:56  <peter1138> I'm kinda not joking.
22:05:58  <LordAro> well we've not reached feature freeze yet
22:06:07  <peter1138> We put off massive features and it just gets... never done.
22:07:10  * peter1138 rebases it
22:08:52  <Samu> there are differences between ai_sl.cpp and game_sl.cpp
22:10:05  <peter1138> It builds, ship it!
22:10:15  <Samu> gonna try fix this
22:10:23  *** Wolf01 has quit IRC
22:10:45  <andythenorth> it has been more widely play tested than normal
22:11:00  <andythenorth> there was no NoAI or NoGo support iirc though
22:11:49  <Samu> btw I found a way to detect if a GS is active in scenario editor without resorting to my ai gui stuff
22:11:56  <Samu> ai debug window
22:12:05  <Samu> how could I forget
22:12:30  <peter1138> Hmm.
22:12:47  <supermop_work_> peter1138: if you don't put it in 1.9, when will it go in
22:12:47  <Samu> the big Game Script rectangular button is not grayed out if it's active, and it is if it's not
22:12:57  <peter1138> They do build road vehicles at least :p
22:13:05  <andythenorth> it will go in 2.0
22:13:08  <peter1138> Did AIs ever build trams?
22:13:10  <andythenorth> otherwise known as 10.10
22:13:14  <peter1138> 1.10
22:13:23  <andythenorth> oops too many 0
22:14:26  <andythenorth> at least nrt has nml support :)
22:14:41  <supermop_work_> i just mean, people have been messing about with NRT since before 1.8
22:14:43  <andythenorth> not merged but eh
22:14:44  <peter1138> Ok, they build tramlines too.
22:14:56  <peter1138> Not efficiently, mind.
22:15:11  <peter1138> No trams on it, haha
22:15:27  <supermop_work_> and it works pretty ok, most of the 'problems' seem to be philosophical differences as to what NRT might do
22:15:55  <supermop_work_> but without it in, idk if you will get a better critical mass of testing than you do now
22:16:15  <peter1138> ^^
22:16:30  <supermop_work_> at least, i am certainly not motivated to do more nrt grf work for the past year-ish
22:17:57  <peter1138> Hmm, no notification.
22:18:39  <Samu> loading a scenario is loaded as if it was a savegame
22:18:47  <Samu> is there a distinction?
22:18:55  <peter1138> No, they are the same.
22:19:04  <Samu> ok, that's the problem
22:19:12  <m3henry> What would count as a big enough change to make 2.0?
22:19:46  *** andythenorth is now known as Guest479
22:19:46  *** andythenorth has joined #openttd
22:19:57  <Samu> or maybe the problem is during save
22:19:59  <LordAro> i'm not sure anyone knows
22:20:02  <Samu> have to investigate this
22:20:31  <andythenorth> stick nrt in the RC, revert if fail?
22:20:35  <andythenorth> or just fix?
22:20:37  <m3henry> Probably best to go with 1.10 then
22:20:44  <andythenorth> it's not like we force upgrades on people
22:21:22  <LordAro> depends how badly it fails, i imagine
22:21:51  <m3henry> lol
22:22:38  <peter1138> Lots of subtle things are touched.
22:23:35  <DorpsGek_II> [OpenTTD/OpenTTD] PeterN updated pull request #6811: Feature: Add NotRoadTypes (NRT)
22:23:43  <peter1138> That took you a while...
22:23:49  <DorpsGek_II> [OpenTTD/OpenTTD] PeterN dismissed a review for pull request #6811: Feature: Add NotRoadTypes (NRT)
22:26:04  <DorpsGek_II> [OpenTTD/OpenTTD] M3Henry commented on issue #7125: Convert singleplayer game to multiplayer server
22:26:14  *** Guest479 has quit IRC
22:27:06  <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on issue #7125: Convert singleplayer game to multiplayer server
22:27:48  <peter1138> If it add it to beta1, we'd get loads of testing.
22:27:54  <peter1138> And mostly no bug reports, but still.
22:30:32  <peter1138> docs/landscape.html is wrong.
22:31:13  <peter1138> Apparently I never updated the docs when I did the 16 -> 64 change.
22:33:27  <andythenorth> :P
22:33:30  * andythenorth bed
22:33:32  *** andythenorth has quit IRC
22:34:21  <Samu> launching scenario editor does it correctly
22:34:33  <Samu> loading a scenario does it wrong
22:34:42  <Samu> hmm
22:41:36  <m3henry> Can't believe I hadn't thought until now to do a dist upgrade
22:45:47  <Samu> SM_EDITOR versus SM_LOAD_SCENARIO
22:53:34  *** Thedarkb-T60 has quit IRC
23:00:16  <Samu> nop
23:00:36  <Samu> there is no stopping a GS from starting
23:03:01  <Samu> AI:
23:03:07  <Samu> GS:
23:03:24  <Samu> GS needs something similar to what's in the AI
23:03:52  <Samu> or else, scenario editor will always load and activate GS
23:04:14  <Samu> how to solve
23:08:02  <Samu> IsValidOwnerDeity
23:09:50  *** snail_UES_ has joined #openttd
23:11:04  *** keoz has quit IRC
23:12:31  *** octernion has quit IRC
23:12:58  *** Thedarkb-T60 has joined #openttd
23:18:51  *** supermop_work_ has quit IRC
23:23:28  <guru3> what months does property maintenance come due?
23:23:40  <Samu> monthly
23:23:47  <guru3> nuts
23:24:45  <Samu> can't treat OWNER_DEITY as a company
23:24:47  <guru3> also thanks
23:24:58  <Samu> what can I do:(
23:27:21  *** HerzogDeXtEr has quit IRC
23:46:50  <peter1138> Hmm, why do we need to introduce electrified road and non-electified trams
23:49:43  <Samu> because
23:49:49  <Samu> no idea
23:56:09  *** m3henry has quit IRC

Powered by YARRSTE version: svn-trunk