Time Nick Message 02:13 rodrigo-morales [Question] Is it possible to include comments in command blocks? I tried using "--", but I got "The command -- does not exist". I'm asking because I want to annotate the code of those commands blocks which contain many lines of code. 19:13 MTDiscord you could do //lua --[[ your comment here ]]-- 19:13 MTDiscord perhaps 19:14 MTDiscord But why wouldn't you write the code elsewhere and paste it in? 19:50 rodrigo-morales mistere_123: Thanks! I'll be annotating code in command blocks using this for now: /lua -- 19:53 rodrigo-morales mistere_123: I don't understand your last message. How writing the code elsewere and pasting it into a command block would solve the problem of "--" raising the error "The command -- does not exist"? If I write the code in an external text editor (e.g. gedit) and then paste it inside a command block, the content in the text editor and the content in the command block would be the same, right? 19:53 MTDiscord I mean, you have a separate, commented copy, and a version that is all in one line. 19:54 MTDiscord IDK, your way is probably better 20:34 MTDiscord you could always just make a simple mod with a dummy command that does nothing, to be used as a comment 22:31 erle trying to compile … has something changed about the linking step between 5.7.0 and 5.9.0 that makes it take much longer, increases by CPU temperature to 80 degrees celsius and makes my laptop smell slightly like burnt plastic? 22:32 erle if so, how do i turn whatever-it-is off? 22:32 MTDiscord lto 22:32 erle what is that? 22:33 erle or rather, what benefits does it bring? 22:33 erle right now it just makes my computer hot 22:33 MTDiscord https://letmegooglethat.com/?q=compiler+lto 22:34 MTDiscord https://github.com/minetest/minetest/pull/14198 22:34 erle thx 22:34 erle for reference, it appears to hang about here: https://mister-muffin.de/p/EfCE.txt 22:35 erle also i do not understand this error message: src/gui/guiTable.cpp:240:38: warning: argument 1 value ‘4294967295’ exceeds maximum object size 2147483647 [-Walloc-size-larger-than=] 22:35 erle (it is in the linked text file) 22:35 MTDiscord lto runs at the end, so its probably not that 22:35 erle any idea how to debug the linking process? 22:36 erle i have no idea how linking can even be broken :/ 22:39 erle wsor4035 i do not understand how to turn IPO/LTO builds off. do you know? if so, do you want to tell me? 22:39 erle like, i could set debug build, but then i have to rebuild everything again? 22:40 cheapie I would expect the build option called ENABLE_LTO to have something to do with whether LTO is enabled 22:40 MTDiscord you'd pass -DENABLE_LTO=OFF to cmake 22:40 erle so i *do* have to rebuild everything, correct? 22:40 MTDiscord LTO is only done during the linking step 22:41 MTDiscord as i previously said, if its doing it only at 34%, unlikely lto - but anyways https://github.com/minetest/minetest/blob/master/doc/compiling/README.md?plain=1#L34 22:41 erle wsor4035 the percentages are bullshit anyway if you ever resume a build (and likely before), i complained about that ages ago. 22:42 MTDiscord i dont want to get into your bullshit 22:42 erle well, you can check that by quitting a cmake + make build just before linking, then typing “make” again. it will probably be at 30 something percent. 22:43 erle thanks so far, i will try to compile again 22:43 cheapie I've observed the same cmake issue here, not just in this specific project, seems everything that uses cmake does it. 22:44 cheapie (the nonsense percentages, not the hanging - I've never had the linker hang) 22:44 MTDiscord cmake's ninja generator shows the exact amount of build steps left out of the total amount of build steps it does. don't know why the makefile generator does a percentage 22:46 erle both of it is broken for my use case anyways, but i have understood that most people are entirely uninterested in improving build systems logic unless you show immediate huge gains. which in some projects leads to them using a single large precompiled header in a way that incremental builds suck (because the precompiled header has to be rebuilt). 22:46 cheapie Does the ninja generator work for compiling Luanti on Linux too? I would use it, but I'm used to changing the generator to anything other than specified/default being an "it will fail to build, the error message will have no results on Google, and nobody will be able to figure out the problem ever" type thing for most projects. 22:46 erle ROllerozxa what are valid values for ENABLE_LTO? like, why is it in the docs and OFF instead of FALSE? 22:46 MTDiscord I'm using ninja to compile Minetest usually and it works fine 22:47 MTDiscord 0 / OFF / FALSE vs 1 / ON / TRUE all work IIRC 22:47 erle yeah but why does it say then? 22:47 MTDiscord this is a cmake thing 22:47 erle ENABLE_LTO= - Build with IPO/LTO optimizations (smaller and more efficient than regular build) 22:47 erle right in the docs 22:47 MTDiscord it depends on the build type 22:47 MTDiscord release builds have it enabled by default 22:47 erle oh thx 22:47 erle it's not a type hint 22:47 MTDiscord lol 22:50 erle cheapie i don't think ninja can be much worse than make. last i checked it had the same basic structure with some extra features, but in the end, it is still a “bottom-up, topsort, timestamps, no hashing” type of thing 22:50 MTDiscord cheapie: all cmake generators should be supported if the project's cmakefiles don't do very crazy stuff, so it should be fine for minetest 22:50 erle so i would be very surprised if it is not just doing what make does but better/different 22:50 cheapie I guess most projects do "very crazy stuff", then :P 22:51 erle s/topsort/toposort/ 22:51 MTDiscord I always generate ninja build files with any cmake project I've come across and never had any issues, across building from source on linux and windows 22:51 MTDiscord i have a rough feeling that ninja does more intelligent scheduling then make and thus manages slightly shorter overall build times but don't quote me on that 22:52 erle luatic ninja is advertised as a fast build system, but it is not particularly fast for every use case. it does some trade-off bets to be faster in a full rebuild, but those hurt in incremental builds. 22:52 MTDiscord the improvement by ninja compared to make when using cmake generators is subtle but still something I find worth it. the fact it defaults to my core count without having to type anything extra is another nice touch 22:53 erle like, ninja sometimes rebuilds files even though it is unnecessary, because the bet is that rebuilding this file is on average better than checking if it has to be rebuilt + rebuilding 22:53 erle i have found this to be generally true for clean rebuilds and almost always false for incremental builds, but i guess this shows why they do it 22:54 erle basically, you can outperform it with a few lines of shell script for a specific case (e.g. a single project), but you are unlikely to do that for the general case 22:55 MTDiscord here we go again 22:55 erle well i just want a working binary 22:55 erle you started talking about build systems :P 22:56 erle (code's compiling) 22:57 erle ROllerozxa luatic do you by any chance have an idea what this means? src/gui/guiTable.cpp:240:38: warning: argument 1 value ‘4294967295’ exceeds maximum object size 2147483647 [-Walloc-size-larger-than=] 22:57 erle i mean it happens when i want to build the binary for 5.9.0 22:58 erle but that line is simply reading: TempRow *rows = new TempRow[rowcount]; 22:58 erle which is: s32 rowcount = std::min(((u32)content.size() + colcount - 1) / colcount, (u32)S32_MAX); 22:59 MTDiscord aggressive inlining as done in LTO enables more static analysis 22:59 MTDiscord and it looks like there as some false positives. i know of another one at least. i'm not sure if this is one yet but the code doesn't look problematic to me. 23:00 MTDiscord I don't see why rowcount isn't u32 though. 23:00 erle why do you think it is a false positive? 23:02 MTDiscord because the logic looks fine to me 23:03 specing run luanti in a DMZ VM, be happy 23:03 erle compile 23:03 MTDiscord i'm not sure where it takes the 2^32 - 1 (u32 max) from, especially since there is an explicit std::min with 2^31 - 1 (s32 max) 23:03 erle specing i am trying to compile it 23:05 MTDiscord hmm well i suppose the u32 in the first std min argument could overflow and end up as something like that 23:05 MTDiscord not exactly a real concern though 23:05 MTDiscord using the proper unsigned types should fix the warning 23:07 MTDiscord i'm not sure what the heuristics for warning here are though, because if it's looking for places where an allocation size may become larger than ptrdiff, i think there should be quite a few more. 23:10 erle not exactly a real concern though 23:10 erle are you trying to the “integer overflow checks are for chumps” lore? ;) 23:10 erle *to add to 23:11 erle well let's see if this is also complained about without LTO 23:13 MTDiscord if you've got a vector (content) with a gazillion entries here, minetest is already committing die. i'm pretty sure this can't happen though for various reasons (e.g. the formspec size limit). 23:13 erle so how would you calculate the largest possible object size? 23:14 MTDiscord i think ideally the language should add asserts that guard against integer overflows, with an option to enable these in release mode, as zig does. 23:14 MTDiscord erle: something like 65k if i remember correctly (formspec size limit, entries in content are comma-delimited iirc) 23:14 erle what is your opinion on frama c? 23:14 MTDiscord frama c? 23:15 erle luatic sorry, what is “65k” the answer to? 23:15 erle https://en.wikipedia.org/wiki/Frama-C 23:15 erle you can annotate code with preconditions and postconditions 23:15 MTDiscord the largest possible size of content which should also be an upper bound for rowcount considering the formula above 23:15 erle and let a static checker figure out if these holds 23:15 erle maybe i was not clear: how do you derive that formula? 23:15 erle i mean these are very big values 23:16 MTDiscord you already sent the line yourself: s32 rowcount = std::min(((u32)content.size() + colcount - 1) / colcount, (u32)S32_MAX); 23:16 erle yes but i do not know why it was written that way 23:16 erle i am never going to have S32_MAX rows i think? 23:17 MTDiscord whoever wrote it that way probably didn't either 23:17 MTDiscord the signed type here doesn't make much sense 23:17 erle luatic why not? 23:17 erle it was added in commit ieb52a149a0 – Enable IPO/LTO by default except for debug builds (#14198) 23:17 ShadowBot https://github.com/minetest/minetest/issues/14198 -- Enable IPO/LTO builds by okias 23:18 MTDiscord LOL 23:18 erle or changed 23:18 erle (git blame says that) 23:18 MTDiscord i guess LTO brought up this warning and it was silenced this way? 23:18 erle before that it was 23:18 erle s32 rowcount = (content.size() + colcount - 1) / colcount; 23:18 erle no, i get the warning with LTO, compiling on x86 (could that be it?) 23:19 erle seriously, though, i don't understand why it was changed 23:21 MTDiscord hmmm i should check whether this is actually a min of s32's or a min of u32's :thonking: 23:22 MTDiscord i.e. when C++ infers the types, does the return type take precedence or do the argument types? i think it's the latter which would render my reasoning from before wrong but that seems to contradict the compiler warning 23:22 erle this is why i suggested frama c to you 23:22 erle you can use it to understand code 23:22 MTDiscord C++ code? 23:22 erle because it can show you if some assertions you make about it hold or not 23:23 erle frama-clang exists, it can *allegedly* analyze C++, but i have never tried it 23:23 erle https://frama-c.com/fc-plugins/frama-clang.html 23:23 MTDiscord interesting 23:24 erle people often think code works like X whereas it actually does Y 23:25 erle annotating your assumptions helps a lot 23:25 erle especially if a program like this can check if they hold 23:26 erle i vaguely remember some coordinate (?) function years ago that multiplied three (or two?) s16 and tried to fit the result into an s16 too :D 23:26 erle or was ut u16? idk 23:26 MTDiscord lol it looks like s32 x = std::min((u32) y, (u32) z) actually infers the min to be a min of s32 so i (and the compiler) were right 23:27 erle how did you figure that out? 23:27 erle don't say godbolt :P 23:27 MTDiscord indeed i was too lazy to read the spec 23:27 MTDiscord but compilers must know 23:27 specing erle: re LTO: ccmake shows ENABLE_LTO *ON in GUI 23:27 MTDiscord there is no way this is undefined / implementation defined behavior 23:28 MTDiscord this must be spec-defined and i'm just using my compiler as a shortcut to access that information ;) 23:28 erle anyway, the reason i am compiling is because wuzzy forked unicode_text to include it in repixture, but made it incompatible on purpose and replied to “please rename it if you make it incompatible” with “ok, i put it on my infinite TODO list” so i thought i could speed that process up by sending a patch, but for that i need to be able to verify i am not just doing the “LGTM” thing 23:29 erle for the record, if you want unicode_text to not render specific scripts, just give it a font that does not contain those. do not patch it to ignore character ranges. 23:30 erle indeed i get no warning without LTO! 23:30 erle and the linking stage is actually fast and does not produce burnt plastic smell 23:31 MTDiscord i usually use relwithdebinfo builds without lto for testing things 23:31 erle why did you remove the clouds from the main menu? 23:32 erle also why does it crash when i join a world? 23:32 MTDiscord huh? 23:32 erle seriously 23:33 erle also the text rendering is all messed up 23:34 MTDiscord no wait i got it the wrong way around with the s32 and u32 23:34 MTDiscord ... so how does the compiler warning make sense then? 23:35 MTDiscord erle: that sounds odd, file a bug. this is a clean build? 23:35 erle luatic i am banned from filing bugs, remember? 23:36 MTDiscord has this ban not expired 23:36 erle while i was working on a rendering bug too 23:36 * specing laughs 23:36 MTDiscord or how long is it until it expires 23:36 erle you tell me 23:36 MTDiscord idk 23:37 erle wait can you query me? 23:37 MTDiscord i had assumed it had expired since you popped back on here 23:37 MTDiscord query you in what sense? 23:37 erle on irc 23:37 * specing laughs harder 23:37 erle luatic AFAIK i was specifically banned from opening issues and participating in the dev channel, nothing else. 23:38 erle well and my PRs got closed 23:38 MTDiscord i don't quite remember the specifics except i voted against the ban 23:39 erle you are the turret in portal saying “i don't hate you” ;) 23:40 erle luatic anyway, any idea what causes this? https://mister-muffin.de/p/EmXJ.png 23:42 * specing puts the laughing into a seperate thread so useful work may be done concurrently 23:42 erle okay, game does not crash when i specifically disable shaders. some fun-hater has set it up so that it no longer works on old machines with default settings. 23:43 erle i have seen such things before. within about 2 or 3 releases you can figure out that “it does not work anyways with default settings” and remove the code which is (as far as i can see it) still working. 23:43 MTDiscord define old 23:43 erle but i guess setting the shader setting to a hardware appropriate value is a thing i'd open an issue about 23:44 erle specifically because i am sure i never enabled that setting 23:45 MTDiscord there are plans to drop the fixed pipeline, and for that we first have to see how to fix cases like yours, assuming they are sensible to support 23:45 erle well it works if i disable shaders 23:45 erle just like before 23:45 erle so i think someone just forced the value to true, no? 23:46 erle regardless of hw support 23:46 erle also i think removing the clouds from the menu is sad, but i may be a bit biased, given i had a hand in making them 3d. and the menu is probably going to be overhauled anyway. 23:47 erle luatic tbh i'd be perfectly happy if it just keeps working, no new effects or anything. 23:47 erle did you look at my screenshot though? 23:47 MTDiscord i did 23:47 erle i have no idea what causes the text rendering issues 23:47 erle do you? 23:48 MTDiscord the thing is that we were not aware of such issues with the shader-based pipeline, and to an extent changing the default seems to be the only way to become aware 23:48 erle this has nothing to do with shaders AFAIK 23:48 erle i mean i disabled them 23:49 MTDiscord erle: you said you couldn't start a game with shaders enabled (it crashes), didn't you? 23:49 erle yes, but i was just complaining about the text rendering 23:49 erle separate thing 23:49 erle sorry 23:49 MTDiscord okay 23:50 MTDiscord what happens when you change the video_driver setting and restart (try all drivers)? 23:52 erle mineclonia works perfectly for me, 29fps at 200 view range, down to 25fps when mapgen works 23:52 erle i guess someone optimized the mesh building for the terrain heavily? 23:52 erle whatever it was, congratulations 23:53 erle well, i also changed from a T60 to an R60, but i doubt that makes too much of a difference 23:53 erle i usually play at 100 view range or less, so i am very happy about the performance 23:53 MTDiscord anyways erle, if each character is rendered as a texture, i would expect to see something like this if the texture wrapping is misconfigured 23:54 erle ah, so where is it configured? 23:54 erle the video driver is opengl. i try ogles1 now. 23:55 erle 2024-10-30 00:54:51: ERROR[Main]: Invalid video_driver specified: ogles1 23:55 MTDiscord why is ogles1 still in the video driver dropdown 23:55 MTDiscord yeah it's been removed 23:55 erle 2024-10-30 00:55:34: ERROR[Main]: Invalid video_driver specified: ogles2 23:55 MTDiscord and I assume you haven't built with GLES support anyways, if you want to use ogles2 23:56 MTDiscord yeah 23:56 erle 2024-10-30 00:55:59: ERROR[Main]: Invalid video_driver specified: opengl3 23:56 erle i don't think i can change video drivers 23:56 MTDiscord yeah doesn't look like you can 23:56 MTDiscord though, no OGL 3? how old is this thing? 23:56 erle how do i find that out?* 23:57 MTDiscord i don't know i was hoping you knew :P 23:57 erle also why do you care if its old, if i get 30fps at 200 view range with a game like mineclonia? i mean that means it works *really* well 23:57 MTDiscord (luars: invalid video driver means it wasn't built with that support at compiletime) 23:58 erle i have tried OGLES2 in the past but i got the impression that it is not *really* OGLES2 as in “any OGLES2 conformant GPU can do it”, but more like “my gamer GPU which can also OGLES2 can do it with OGLES2 driver” 23:58 MTDiscord apparently the highest opengl version the R60 would have is 2.1 23:59 MTDiscord right, iirc the OGL3 driver depends on SDL, doesn't it..? 23:59 MTDiscord yes it does 23:59 erle haha, the fps still drop when inventory is opened lol 23:59 MTDiscord so when SDL was disabled it was probably forgotten to edit the settingtypes to take it out?