Time |
Nick |
Message |
01:30 |
|
v-rob joined #minetest-dev |
01:53 |
|
v-rob joined #minetest-dev |
02:15 |
MTDiscord |
<Jordach> first river algo prototype works |
02:15 |
MTDiscord |
<Jordach> https://cdn.discordapp.com/attachments/747163566800633906/959274687727296542/unknown.png |
02:15 |
MTDiscord |
<Jordach> https://cdn.discordapp.com/attachments/747163566800633906/959274880522653746/unknown.png |
02:28 |
|
queria joined #minetest-dev |
02:33 |
|
v-rob joined #minetest-dev |
02:34 |
|
queria joined #minetest-dev |
02:56 |
|
v-rob joined #minetest-dev |
03:49 |
rubenwardy |
Zughy, x2048: being able to customise the light curve is something that's requested a lot |
03:50 |
rubenwardy |
Also, a saturation adjustment post effect doesn't feel like a lighting thing |
04:00 |
|
MTDiscord joined #minetest-dev |
04:41 |
|
yzziizzy joined #minetest-dev |
04:46 |
yzziizzy |
Not sure if this is the right channel, but 5.6.0-dev-3dd7d7867 (pulled a few minutes ago) seems to duplicate then leak global variables from mods in lua |
04:46 |
yzziizzy |
It appears to do this in relation to generating new chunks |
04:46 |
yzziizzy |
https://pastebin.com/pfS16Tg1 |
04:47 |
yzziizzy |
Fly into ungenerated areas and you can see the memory usage rise. In a few minutes the game crashes with an error saying Lua went over its memory limit |
04:47 |
yzziizzy |
... or maybe I'm missing something. |
04:49 |
yzziizzy |
The example uses 40mb all at once just for demonstration. It also happens for me eventually with lower usage. |
04:51 |
yzziizzy |
This is a fresh install. I've only jacked up the default graphics settings, and adjusted default_privs for development convenience |
05:22 |
|
calcul0n joined #minetest-dev |
05:24 |
|
v-rob joined #minetest-dev |
06:07 |
Zughy[m] |
override_day_night_ratio makes MT crash if no argument is passed. It makes sense with the documentation (https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L7004), but shouldn't `none` be accepted as well - like in many other `set` functions? In case I can make a PR |
06:09 |
Zughy[m] |
I mean, yes, it's called `override`, but it looks like a normal `set` function to me |
06:09 |
Zughy[m] |
Like `set_sky` etc |
06:10 |
Zughy[m] |
(with `none` I mean no parameters at all) |
06:42 |
|
v-rob joined #minetest-dev |
06:46 |
sfan5 |
yzziizzy: its pretty much impossible that such a bug was introduced accidentally |
06:47 |
sfan5 |
so it'll be something about your Lua environment that causes this |
06:51 |
erle |
Zughy[m] i see no benefit in changing the function signature here. it introduces an incompatibility with past versions and adds permanent variable arity for literally no benefit than help people who can't be arsed to read the documentation. |
06:51 |
yzziizzy |
Any tips for where to start looking? I'm using system LuaJIT on gentoo. |
06:52 |
erle |
Zughy[m] given that reading the documentation is the first thing someone would do before using that function, how did you even encounter the bug? |
06:52 |
erle |
“bug” |
06:53 |
sfan5 |
which version is it? also check if the GC64 option is enabled at buildtime |
06:57 |
yzziizzy |
2.05-r3 |
06:58 |
yzziizzy |
But.... https://bugs.gentoo.org/685010 |
06:58 |
yzziizzy |
Looks like this is exactly a known issue. |
06:58 |
yzziizzy |
Thanks. I''s recompile with the bundled version |
07:27 |
sfan5 |
2.0.5 is very out of date, you want at least 2.1.0-beta3 or better git HEAD |
07:27 |
sfan5 |
upstream doesn't make releases anymore |
07:29 |
yzziizzy |
Ah. I just got the latest git version and it seems to level off around 1.7gb of memory usage, but doesn't crash anymore. |
07:29 |
yzziizzy |
For the record, /should/ GC64 be enabled or disabled for minetest? |
07:34 |
sfan5 |
it should be enabled so that luajit can properly use all memory available to it |
07:35 |
yzziizzy |
ok |
07:37 |
yzziizzy |
2022-04-01 07:33:07: ERROR[Main]: Current Lua memory usage: 1003 MB |
07:37 |
yzziizzy |
With it enabled, I get this crash. |
07:38 |
yzziizzy |
Do I need to bump up some memory limit in minetest config? |
07:42 |
Zughy[m] |
erle: how exactly is avoiding a crash an incompatibility? By the way, I encountered the crash because - as I was messing with the celestial vault as well - I was expecting it to behave like set_sun, sky etc. |
07:45 |
erle |
Zughy[m] so you did not read the documentation i guess |
07:45 |
erle |
before using the function for the first time |
07:46 |
erle |
Zughy[m] the incompatibility is that new code using the new-argument form will not work in older versions, for no good reason IMO – as functionality is the same if passing nil. |
07:46 |
Zughy[m] |
Yes, I did, and when I read `nil` I thought "ok, it works like the others" |
07:46 |
erle |
hmm, is this maybe a function argument misunderstanding? |
07:46 |
erle |
i thought missing arguments were indeed taken as nil |
07:47 |
Zughy[m] |
no, lua C++ library differentiates between no arguments and nil |
07:48 |
erle |
are you proposing that every function that can have nil as a singular argument also should have a form where it does the same with no arguments? |
07:49 |
Zughy[m] |
on a Lua scripting point of view, it makes sense, as there is no difference between no arguments and `nil` |
07:49 |
Zughy[m] |
this is the line by the way: https://github.com/minetest/minetest/blob/cf650fcaac33af2c60af3880f9b28358e30d75a4/src/script/lua_api/l_object.cpp#L2212 |
07:50 |
erle |
i am not sure if this is a good general principle |
07:51 |
erle |
(i think if you were coding erlang or elixir it would be obvious that it is a bad general principle, at least in those languages) |
07:52 |
Zughy[m] |
I think it is, as modders are not expected to know that C++ treats `nil` and none differently |
07:54 |
erle |
i guess you don't care about the incompatibility then |
07:55 |
erle |
i think it is actually good UX to enforce arity |
07:59 |
yzziizzy |
Looks like LuaJIT is just a broken, abandoned project, based on all the forums. Back to regular Lua it is... |
07:59 |
yzziizzy |
Thanks for your help, sfan5 |
08:00 |
sfan5 |
> Do I need to bump up some memory limit in minetest config? |
08:00 |
sfan5 |
no such thing |
08:01 |
sfan5 |
LuaJIT works fine but you need to take care to use a recent enough version and not accidentally configure it wrong |
08:01 |
sfan5 |
2.1.0-beta3 with GC64 enabled should have none of these issues |
08:03 |
yzziizzy |
That's the version I'm using, with GC64 enabled. Various forums say that it's still limited to 1gb on Linux, apparently. The universal workaround it to use regular Lua. |
08:04 |
yzziizzy |
Something to do with the 32-bit address range flags passed to mmap() |
08:05 |
Zughy[m] |
<erle> "i guess you don't care about the..." <- I care about having a fluid experience, and Minetest is not some software used to launch people into the space anyway |
08:08 |
erle |
Zughy[m] what do you mean with “fluid experience”? |
08:10 |
erle |
Zughy[m] say i accept your argument that functions that set stuff should mirror functions that get stuff. then override_day_night_ratio() should take EXACTLY the arguments that get_day_night_ratio() spits out. which is a single value that represents a ratio or is nil. |
08:10 |
erle |
Zughy[m] there is no way to get *no* value out of get_day_night_ratio() |
08:11 |
sfan5 |
GC64 is the exact thing that lifts the 1/2GB limit |
08:11 |
sfan5 |
but ¯\_(ツ)_/¯ |
08:13 |
yzziizzy |
Who knows. I'll fiddle with it more when I have more time to see if I can flush out the issue. |
08:29 |
Zughy[m] |
erle: what, does get_day_night_ratio() return the current ratio of the day if not overridden? |
08:29 |
Zughy[m] |
it says "returns the ratio or nil if it isn't overridden", so no |
08:29 |
Zughy[m] |
and again, no difference between nil and no argument at all. Or am I wrong? |
08:35 |
Zughy[m] |
also, passing a non existing table field (like player:override_day_night_ratio(a_table.non_existing_field)) apparently doesn't crash the game nor actually reset the player day night ratio. Just, nothing happens |
08:37 |
Zughy[m] |
nevermind about the last one, my bad |
11:27 |
|
proller joined #minetest-dev |
11:49 |
|
proller joined #minetest-dev |
12:25 |
|
Fixer joined #minetest-dev |
13:01 |
|
qur joined #minetest-dev |
15:15 |
|
v-rob joined #minetest-dev |
15:36 |
|
appguru joined #minetest-dev |
15:40 |
|
appguru joined #minetest-dev |
15:42 |
Pexin |
question: at what point in the dev cycle is protocol version expected to bump? |
15:42 |
sfan5 |
at any point when necessary, as often as necessary |
15:44 |
Pexin |
mm. well #11939 has gotten no attention, and I don't know if it's because simply core devs have no time, if core devs hate it to death, or if it's just waiting for proto version bump |
15:44 |
ShadowBot |
https://github.com/minetest/minetest/issues/11939 -- Restore and enhance bouncy behavior by pecksin |
15:44 |
Pexin |
I'm assuming mostly notime available |
15:45 |
sfan5 |
yes |
15:46 |
Pexin |
ok |
15:47 |
Pexin |
(the scope of that PR has grown since created btw, and is definitely more "feature" than "bugfix" now - though it really is both) |
15:52 |
MTDiscord |
<luatic> Zughy: No, nil is not the same as "no arguments" in Lua; you can very well differentiate between the two. But I agree, in most cases it's the same. Unfortunately our docs often say "returns nil" when they actually mean "returns nothing". Luckily this doesn't matter in expressions or when assigning to variables. |
15:55 |
MTDiscord |
<luatic> Most Lua builtin funcs which work on varargs do care about nils. There's select("#", nil) == 1 vs. select"#" == 0. There's math.min(1, 2, 3) which will work just fine and math.min(1, 2, 3, nil) which will throw an error. ("%s"):format() will throw an error while ("%s"):format(nil) won't. |
16:05 |
Zughy[m] |
what do you suggest? |
16:06 |
MTDiscord |
<luatic> nothing |
16:07 |
MTDiscord |
<luatic> as in, return nothing instead of an explicit nil |
16:07 |
MTDiscord |
<luatic> but also accept nothing as an argument and don't require an explicit nil |
16:07 |
MTDiscord |
<luatic> would you write return nil in Lua? probably not |
16:08 |
MTDiscord |
<luatic> some_func(nil, nil, ...) feels about as odd |
16:08 |
rubenwardy |
I do |
16:08 |
rubenwardy |
`return nil` can be clearer about intent than `return` |
16:14 |
|
v-rob joined #minetest-dev |
16:17 |
Zughy[m] |
so you're basically agreeing with me about the override function? |
16:21 |
|
jwmhjwmh joined #minetest-dev |
16:23 |
jwmhjwmh |
If a function is documented as returning nil, it should definitely return nil explicitly. See the problem described here: #11666 |
16:23 |
ShadowBot |
https://github.com/minetest/minetest/issues/11666 -- Make MetaDataRef:get() return nil instead of nothing by TurkeyMcMac |
16:47 |
|
proller joined #minetest-dev |
17:10 |
|
proller joined #minetest-dev |
17:15 |
|
proller joined #minetest-dev |
17:18 |
MTDiscord |
<luatic> jwmhjwmh: agreed, I'd just prefer it if we could fix the docs instead (pretty sure the intention was to say it returns "nothing" and not "nil" and the author just deemed the two synonymous); although I guess technically that's breaking and has to wait for a major release |
17:23 |
|
v-rob joined #minetest-dev |
17:40 |
|
Fixer_ joined #minetest-dev |
18:30 |
|
proller joined #minetest-dev |
18:40 |
|
Desour joined #minetest-dev |
18:55 |
Desour |
:+1: for treating none and nil the same in override_day_night_ratio(), like in (almost?) all other minetest api functions... |
20:01 |
|
v-rob joined #minetest-dev |
20:31 |
|
v-rob joined #minetest-dev |
21:43 |
|
v-rob joined #minetest-dev |
22:34 |
|
panwolfram joined #minetest-dev |
23:36 |
|
olliy joined #minetest-dev |