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