« first day (3836 days earlier)      last day (1095 days later) » 

12:00 AM
@Trowski I can build it locally
CFLAGS="-m32" CXXFLAGS="-m32" ./configure --target=x86-unknown-linux-gnu --disable-all
was the incantation I used ...
...Zend/asm/make_i386_sysv_elf_gas.o Zend/asm/jump_i386_sysv_elf_gas.o...
 
That's exactly what I was expecting… what the hell is going on with Azure…
 
Carrolikj ・ *General Issues ・ #80962
 
@JoeWatkins Does make test TESTS=Zend/tests/fibers pass?
 
yeah
 
Well, so it works. Now I just need to make it work on CI.
 
12:08 AM
have you run your test suite with valgrind yet ?
 
As an extension, yes.
 
12:25 AM
lots of memory errors
Generating files
configure: error: Unable to determine platform for fiber switching context!
and can't build without --target ?
 
@JoeWatkins Yeah, that approach didn't work, I got rid of the last couple commits.
Rebase and it should build without --target.
@JoeWatkins That's surprising. The basic implementation isn't that different.
 
12:49 AM
order of shutdown
your zend_fiber_shutdown function executes before zend_call_destructors
 
Yes, that was on purpose.
It seems to be clearing the hash table twice, is that correct?
 
zend_call_destructors results in free_obj being called, which references the table you freed in fiber_shutdown
 
I likely just need to handle that differently?
 
set nNumUsed in fiber shutdown to 0, if nNumUsed is 0 in free_obj skip the hash_del call
 
I separated the functions so the hash table isn't destroyed until zend_call_destructors.
 
12:57 AM
yeah that also works...
I don't get the refcounting I'm seeing
 
@JoeWatkins Pushed a commit that fixes all the leaks.
Err… not really leaks as use-after-free.
@JoeWatkins You mean in resume/suspend?
 
yeah
oh I think I get it
 
A reference is before entering the fiber context in case the only reference is destroyed while the fiber is running, and then removed once it suspends or terminates.
Thus an unreferenced fiber is only destroyed while its not running
 
1:13 AM
the ZPP block in start is not necessary
	fiber->fci.params = ZEND_CALL_ARG(execute_data, 1);
	fiber->fci.param_count = ZEND_CALL_NUM_ARGS(execute_data);
that ought to be okay
 
Yep, that works.
Makes sense, I'm effectively passing them straight through.
 
	ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 0, 1)
			Z_PARAM_OPTIONAL
			Z_PARAM_ZVAL(value);
	ZEND_PARSE_PARAMETERS_END();

	if (value) {
		ZVAL_COPY(&fiber->value, value);
	} else {
		ZVAL_NULL(&fiber->value);
	}
in suspend
ZVAL_COPY_DEREF from the arg directly ...
 
1:33 AM
What if the param isn't provided though?
 
if (value) -> if (ZEND_CALL_NUM_ARGS())
if (ZEND_CALL_NUM_ARGS(execute_data)) {
    ZVAL_COPY_DEREF(&fiber->value, ZEND_CALL_ARG(execute_data, 1));
} else {
    ZVAL_NULL(&fiber->value);
}
that, replaces
	ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 0, 1)
			Z_PARAM_OPTIONAL
			Z_PARAM_ZVAL(value);
	ZEND_PARSE_PARAMETERS_END();

	if (value) {
		ZVAL_COPY(&fiber->value, value);
	} else {
		ZVAL_NULL(&fiber->value);
	}
I guess it doesn't enforce the limit though, which you want too in this case ...
but you could write an UNEXPECTED case ... it depends how paranoid you want to be about the instructions in these functions ...
 
@JoeWatkins Why ZVAL_COPY_DEREF instead of ZVAL_COPY as before?
 
to deref references
which would be normal behaviour, when you don't declare you accept references
 
So the current ZVAL_COPY is incorrect?
Oh, never mind, now I get it.
ZPP was taking care of that before.
I dunno, is ZPP really slow enough to justify that?
 
1:48 AM
actually you can't get a references
 
Generator::send() use ZPP, so I'm inclined to say we're micro-optimizing now.
 
oh yeah definitely, but I see UNEXPECTED branches, and I'm sorta under the impression that every additional instruction really matters here ...
 
How much does UNEXPECTED really help? For instance in resume, it's on error conditions that shouldn't happen unless the user mis-uses the API.
 
well it can help
it's a hint to the compiler that the branch is highly unlikely to be traveled, it allows the assembler to generate code that better takes advantages of caching
 
It's not that I am seriously concerned about performance, more that I know it will rarely happen so it seems appropriate.
@JoeWatkins Right, I guess I understand it from a high level. I should look into the choices the compiler makes when it's used.
 
1:59 AM
when you have five branches from the root of some code, it's questionably useful to mark three of them as unexpected ...
there are only so many options available when it comes to how the assembler can arrange code in order to take advantage of caching
it has to go somewhere, in other words
it's 4am, I'm going to bed ...
nn
 
Night, thanks for the help! o/
I could move the the access to EG(current_fiber) to the top, then all the unexpected branches would be in a row. My naïve assumption is the compiler can do some optimization around skipping all three.
 
 
1 hour later…
3:34 AM
Incident with GitHub Actions ・ GitHub Pages has Partial Outage
 
>.>
 
<.<
 
^.^
 
v.v
 
... this just looks weird
 
3:49 AM
It's the secret ascii emoji ritual for the secret clan PHP
 
View edit history :P
 
4:26 AM
All issues have been resolved!
Minor Service Outage ・ GitHub Pages has Partial Outage
All issues have been resolved!
 
inb4...
 
Minor Service Outage ・ GitHub Pages has Partial Outage
All issues have been resolved!
 
 
3 hours later…
7:17 AM
Something happened to main
 
 
2 hours later…
9:25 AM
@Crell Nope. Not since my last update. I think the most important thing is figuring out if any future patterns could cause conflicts.
@JoeWatkins It's been renamed to never already I think.
 
10:21 AM
@JoeWatkins Thanks for the is_literal() patch, I've been running some tests, and it seems to work well. I have found a couple of oddities, where I've created some throw-away tests. I'm also wondering if the performance change would be seen as an issue (e.g. 0.203s to 0.206s = +0.003, about +1.5%), considering that test is focused on string concat, and I'm trying to look at the worst case scenario.
 
10:56 AM
@CraigFrancis some of those tests highlight some strange behaviour
tests with a million statements are impossible to debug, we only make very short tests, target one thing
 
@ln-s I have a library for this kind of stuff: packagist.org/packages/danack/params it's not total shite, but also I can't be arsed to work on the documentation.
 
11:17 AM
@JoeWatkins The big file (000.phpt) was really just something I created a few days ago, trying as many different things as I could come up with, the others should just be focusing on a single thing each (and they can all be deleted afterwards).
 
@CraigFrancis literal arrays problem is fixed
 
11:35 AM
@JoeWatkins Thanks, I thought that one was going to be a tricky one (says he having wasted, I think it was Tuesday to it)... I do need to disappear for the rest of the day, but should be free tomorrow morning for a few hours (and thanks again, you’re amazing at this).
 
 
1 hour later…
12:50 PM
@CraigFrancis I think that's mostly sorted, but I'll look again tomorrow ... I haven't dismantled the big test file ... I'll come back to it this evening/tomorrow with fresh eyes ...
I'm going to go outside ...
 
1:00 PM
@JoeWatkins hopefully it's sunny there, enjoy!
 
@JoeWatkins wow you’re quick (I’m also away from proper computer), I don’t think the big test file will be an issue, most were fine (I used that to make the individual ones), but I’ll check tomorrow... hope you enjoy yourself.
 
 
2 hours later…
2:47 PM
@IluTov How do we do that without just implementing everything? The pieces still missing for the initial scope are object decomposition and modifying match().
 
3:16 PM
DateTimeZone::getTransitions() truncated ・ Date/time related ・ #80963
 
3:29 PM
@NikiC where would be the best place to put the function for the error message? github.com/php/php-src/pull/6661#discussion_r614745307
Also I'm not exactly sure I get what you mean with the precision format
Should it be %.*-1H ?
 
@Girgias zend_operators.c would be fine in this case
@Girgias "%.*H", -1, float
 
Okay thanks :-)
 
4:28 PM
Oh the 32bit build is borked?
 
4:56 PM
Did I mess it up?
/home/vsts/work/1/s/Zend/zend_operators.c:814:78: error: unknown conversion type character ‘ ’ in format [-Werror=format=]
814 | zend_error(E_DEPRECATED, "Implicit conversion from non-compatible float %.*H to int", -1, d);
| ^
/home/vsts/work/1/s/Zend/zend_operators.c:814:27: error: too many arguments for format [-Werror=format-extra-args]
814 | zend_error(E_DEPRECATED, "Implicit conversion from non-compatible float %.*H to int", -1, d);
 
5:07 PM
@NikiC Would it allow new optimizations if class constants could be prevented to be overridden (final const)?
 
@MateKocsis no
I think the only case where it would be useful is for static::FOO
 
Yeah, that's what I thought about
 
Well, and I guess $this::FOO, which is the same thign
All other references are against a specific class
And the only reason to write static::FOO would be if you specifically intend to overwrite constants, so...
@Girgias You may need to add an _unchecked function :(
 
It came to my mind because doctrine coding standard has a specific rule to disallow static::FOO calls (github.com/doctrine/coding-standard/blob/9.0.x/lib/Doctrine/…), and I thought that it would be better to just allow making constants final
 
@NikiC For zend_error? or should I format the string before hand using an existing one?
Could I not just use a pragma to ignore this for that function?
 
5:44 PM
@NikiC The i386 builds on Azure are frustrating because it selects x86_64 for the fiber switching context. Any suggestions on how I could force it to choose i386?
Here is how the assembly file to use is determined.
 
6:18 PM
@Crell It's enough if we create a POC with just the parser changes, which is likely just a couple dozen lines. E.g. $foo is int|string is ambiguous because it can be parsed as $foo is (int|string) or ($foo is int)|string. Similarly, $foo is (int or string) vs ($foo is int) or string. Not sure what to do with those...
 
6:35 PM
 
@NikiC I'll rebase and see.
 
o/
@NikiC Yes it did, thank you sir!
Unfortunately some of the tests are failing. @JoeWatkins everything passed for you on 32-bit build, yes?
 
7:01 PM
@Trowski yeah
 
Great… so something is still broken about the way Azure is building that.
@JoeWatkins Did you build with ZTS?
I think it's only segfaulting on the tests that call zend_error_impl, so that narrows what could be going wrong quite a bit.
 
7:20 PM
@Trowski yeah
 
7:44 PM
I can't repo it either, so it's something specific to that build. Ugh…
 
 
1 hour later…
9:10 PM
@CraigFrancis I found a couple of things that were wrong/strange, also pushed a few more tests, I think we should have pretty good coverage now ... I'll look again tomorrow, and at some point, look at the actual coverage number (I dont run coverage builds locally) ...
when it comes to internal/user symbols (classes/functions), whether or not the internal version has literal strings is an implementation detail that we can't really change here, for example, internal function arg info does not use zend_string, so it can't report that it's a literal, but the user equivalent does (because they typed it) ... but both internal and user class/methods/functions use zend_string for their name, so they all report they are literals ...
in the internal case, it's true that they aren't really literal strings, however, we want user symbols to have literal names, and that extends to internal classes too ...
the inconsistency in arg info will be fixed when the arg_info problem is fixed, so PHP9, I would hope ...
 
10:00 PM
Does anyone know why the php manual is returning true in the constructor of the first example? php.net/manual/en/function.get-class-vars.php ? That line should be omitted from the demo as misleading/unnecessary, right?
 
@JoeWatkins Thanks Joe, hope you got to enjoy yourself outside... I should be back at my computer for a few hours tomorrow morning, would these changes be on the same branch you created a few days ago? And thanks for the explanation about the symbols, I think I understand, and it’s not something that would affect my systems, where I’m fairly sure it’s not something anyone else would notice either.
 
@CraigFrancis same branch, named literals, I just been rebasing and force pushing
 
10:14 PM
@JoeWatkins Perfect, saves having lost of commits (erm, in a similar way, how many times have I written the comment “fix” or “final”, to later find out it wasn’t fixed or final).
 
@IluTov "Complex stuff requires parens, deal" seems like a not-terrible solution to me?
 
10:30 PM
+1
 
@mickmackusa yes, that's bogus
By the presence of var, you can guess when this code was written...
 
cmb
@mickmackusa maybe you want to provide a PR?
 
10:53 PM
w00t... don't think i've ever been so excited about dots and xs github.com/labrador-kennel/async-testing/blob/main/…
 
11:04 PM
@CharlesSprayberry if you want people to get excited about dots, boy do I have the audience for you what3words.com/dots.dots.dots
 
lol
Well, I'd prefer they get excited about what the dots represent
I don't know... I see a unit testing framework that can run on a single amp Loop that'll solve a lot of problems for me
 
they represent Basingstoke, what's not to love
 
I know it still has a lot of work to do but I'm feeling pretty good about it so far
 
oh, right
@CharlesSprayberry so that sounds awesome and I wish I were in a state of mind that could deliver some useful feedback
 
@DaveRandom No worries! I think it sounds awesome too. I have a lot of documentation written up on what I want to do
 
11:07 PM
omfg wait I might have something to bring to this table for one (not now)
 
...cat puke?
 
a loog long time ago I wrote the mad-add mine framework used in phpt consurrent tests
it is a hateful picee of code which involves tests that have bits of PHP in nowdocs
it exists purely because NIH but maybe if userland can test stuff properly it can go away
> mad-add mine
mad-ass mini, but also I am going to bed
 
That's what I'm aiming for
so that each TestCase assigned to the DatabaseTestSuite uses the same connection and all the other cruft with doing stuff like this is taken care of
@DaveRandom Now or whenever I'm eager to get some feedback on the idea so whenever it comes to you let me know ;)
Eventually maybe get to where we parallelize the test suites so the database one happens on a separate process while the other normal tests can carry on like normal
 
(guess what I didn't end up going to bed) this is an obvious statement I guess but the point of unit tests is to test a logical unit - my gut feeling is that is you do anything other than run a set of tests in isolated sequence then the tests are not tests, so I would caution against trying to build in any kind of parallelisation
 
that's super far off
honestly don't know if it would ever got that point tbh
i'm so far off from that point really i'm just day dreaming :P
 
11:22 PM
I remember the feeling :-/
 
right now i just want to solidify the assertion API and make sure some other expected functionality is in place
 
the idea of being able to write essentially a phpunit test that automagically folds generators into a loop is a thing I like a lot
 
@DaveRandom And the library is actually compiling the test data to execute before we run anything. We could in theory compile and cache the test information and decide what to run on separate processes before we start executing code... basically have a Worker that executes a TestSuite ... all the TestCases assigned to that TestSuite would run in the same process on the same Loop
@DaveRandom Yea... a PHPUnit adapter is something I'm thinking about
 
@Crell Well, it's inconsistent, and probably not logical to the user. It's also annoying because it's basically just a parser limitation. ($foo is int)|string is rarely if ever useful, because why would you bitwise or a boolean with a constant? But yeah, the case with or is even less clear because that one might have some reasonable applications.
 
So you could take existing tests and extend a new test case and pop in a trait or something
I figure for the most commonly used assertions that should be straight forward
But PHPUnit has a lot of assertions lol
 
11:28 PM
@CharlesSprayberry cool as it sounds, it also sounds very abstracted away from useful debug info... like all async stacks
 
@DaveRandom yea for sure... also like i said super daydreaming at this point
mostly just trying to poke holes in the idea (or poke holes in it)... in my roadmap i ahve it in the "nice to haves that i'm not sure will ever get done"
figuring out the debug information is definitely one of those things for sure
 
that sounds quite negative but ftr I hope you know something I don't
 
it doesn't sound negative to me
you're thinking about things i need to consider
and what i'm trying to do is difficult... i've looked into the plumbings of phpunit to see what it is doing and to write an effective unit testing framework is not necessarily simple.... especially throwing in async
 
I have tried to make mental sense of how to organise this stuff in my head and failed, I am hoping for someone cleverer than me to help me make sense of it :-P
 
why i'm trying to solicit feedback early on :P
 
11:31 PM
ftr @CharlesSprayberry having cast my fairly inexpert eye over it I approve of your ideas and approach, fwiw :-P
 
@DaveRandom awesome! well i have a lot of stuff written and i'm going to continue to post meaningful updates
 
I also love you with all of my soul and would die before I let you perish, but that's another conversation I guess
 
unrelated to the previous message :-P
 
@DaveRandom that's what you are now pretending
 
11:39 PM
send help im trapped in a cspray factory
 
@DaveRandom ahh.. you're making me blush
 

« first day (3836 days earlier)      last day (1095 days later) »