Skip to content

Merge remote-tracking branch 'upstream/mangle' into merge_mangle #6998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Aug 18, 2017

Conversation

MartinNowak
Copy link
Member

No description provided.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @MartinNowak!

Bugzilla references

Auto-close Bugzilla Description
15831 IFTI voldemort type exploding bloat

@MartinNowak
Copy link
Member Author

Thanks Rainer for your persistent work on this ;).

@MartinNowak MartinNowak requested a review from rainers July 16, 2017 14:31
@MartinNowak
Copy link
Member Author

Looks like vibe-d found a small phobos problem with this.
https://ci.dlang.io/blue/organizations/jenkins/dlang-org%2Fdmd/detail/PR-6998/1/pipeline#step-526-log-30

/var/lib/jenkins/dlang_projects/distribution/bin/../imports/std/traits.d(1063,21): Error: slice [38..32] exceeds array bounds [0..32]

/var/lib/jenkins/dlang_projects/distribution/bin/../imports/std/traits.d(1063,21): Error: template instance std.traits.ParameterStorageClassTuple!(void function(HTTPServerRequest, HTTPServerResponse)).demangleNextParameter!("CQBlQBjQBh18HTTPServerResponseZv", 1LU) error instantiating

@rainers
Copy link
Member

rainers commented Jul 16, 2017

fail12485.d is a rather ugly test: it wants to produce an error on recursion, but does so only by the length of the symbol. Should we add a recursion check elsewhere?

@rainers
Copy link
Member

rainers commented Jul 16, 2017

druntime failures are due to mangled names being compared by profiler tests. Can we assume ddemangle to be available to compare demangled names?

@MartinNowak
Copy link
Member Author

druntime failures are due to mangled names being compared by profiler tests. Can we assume ddemangle to be available to compare demangled names?

I'd rather not as it adds a dependency on an up-to date ddemangle being installed on all CI systems.

@rainers
Copy link
Member

rainers commented Jul 16, 2017

I'd rather not as it adds a dependency on an up-to date ddemangle being installed on all CI systems.

I've opted to allow both manglings for now, the old version can be removed later: dlang/druntime#1878

@rainers
Copy link
Member

rainers commented Jul 16, 2017

Now the druntime patch is merged, I see two issues left:

  • jenkins fails because reimplement std.traits.ParameterStorageClassTuple() phobos#5427 has been reverted. IIUC __traits(getParameterStorageClassTuple) also caused errors in vibe.d. Is anyone working on this? @WalterBright

  • fail12845.d now doesn't stop on a mangled symbol component being longer than 8MB, but if the limit of 300 recursive template instantiations is hit. This needs about 5 GB of memory, though. Some machines don't seem to have that much available, i.e. work-vm1, so the build bails out with out-of-memory or is killed otherwise. With 32-bit builds of dmd on Windows, the out-of-memory error code just happens to be 1, as expected by d_do_test for a normal failure.
    Should the test actually try to generate a symbol longer than 8MB or try to hit that recursion limit with less memory?

Copy link
Member

@rainers rainers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the test actually try to generate a symbol longer than 8MB or try to hit that recursion limit with less memory?

@MartinNowak I opted for the former here: MartinNowak#2. Can you merge this into this PR? Or can I do this myself? I'm not used to the workflow, but is this PR open for edits from other?

@wilzbach
Copy link
Member

but is this PR open for edits from other?

Yes.

@wilzbach
Copy link
Member

I'm not used to the workflow, but is this PR open for edits from other?

You can also close this PR and open one from your branch if that's easier for you.

@rainers
Copy link
Member

rainers commented Jul 18, 2017

but is this PR open for edits from other?

Yes.

AFAICT it's not visible in the side bar, only for my own PRs.

You can also close this PR and open one from your branch if that's easier for you.

Thanks for the info. I just pushed to Martins fork, seems to work fine. It even automatically closed my PR against his fork.

@quickfur
Copy link
Member

Just wondering if this will get merged soon. Getting impatient waiting for this to land in master. ;-)

@wilzbach
Copy link
Member

AFAICT it's not visible in the side bar, only for my own PRs.

FYI: it's available when you see the following before the CI status window:

Add more commits by pushing to the merge_mangle branch on MartinNowak/dmd.

(Currently on my phone, so without screenshot)

If you do this more frequently, you might want to have a look at this page:

https://wiki.dlang.org/Guidelines_for_maintainers#Write_access_to_PRs

@rainers
Copy link
Member

rainers commented Jul 18, 2017

@braddr I'm afraid that a bad test in a previous commit continues to allocate memory, but never stops on some build servers even though the build is deleted. One seems to build for 55 hours now: https://auto-tester.puremagic.com/show-run.ghtml?projectid=1&runid=2670646&isPull=true

Can you abort these somehow?

@rainers
Copy link
Member

rainers commented Jul 18, 2017

FYI: it's available when you see the following before the CI status window:

Thanks for the info, found it now. I've seen it before but thought that it would be always displayed.

@wilzbach
Copy link
Member

Now the druntime patch is merged, I see two issues left:

I think the Phobos PR has been merged and the auto-tester is all green. Any other blocking issues? :)

@rainers
Copy link
Member

rainers commented Jul 20, 2017

Any other blocking issues? :)

No objections from my side ;-)

BTW:

@wilzbach
Copy link
Member

No objections from my side ;-)

Noice! 🎉
I retested this branch and now the performance problems are gone. On the contrary:

Library master mangle
Druntime 6.5s 6.3s
Phobos unittest-debug 2:20 min 2:16min

I also tried building Vibe.d, but there's a huge variance of the run time when running the same build multiple times (of course with --force).

most build servers seem to have recovered, but AFAICT one tester still builds this PR: https://auto-tester.puremagic.com/hosts/details.ghtml?hostid=37 and does nothing else. Can someone stop that job?

Yeah ... only @braddr has access to the auto-tester

@wilzbach
Copy link
Member

Root package dpl-docs references unknown package ddox

FYI: this just means that code.dlang.org was unreachable. There are multiple efforts to make DUB more stable, e.g. dlang/dub#1190, dlang/dub#1198, dlang/dub-registry#231

@rainers
Copy link
Member

rainers commented Jul 25, 2017

Added a changelog entry.

The vibe.d failure looks like a tough one to fix: it uses the mangled name during serialization.

Not sure how not to break this, but adding a function that converts the new mangling to the old one could help updating code...

rainers added a commit to rainers/vibe.d that referenced this pull request Jul 25, 2017
This might help dlang/dmd#6998 to pass the tests.

Is the mangling only used for the test in vibe.d or does a change also have an impact on real serialized data?
@rainers
Copy link
Member

rainers commented Aug 15, 2017

Rebased and fixed the mangling of the new builtins.

Github provides refs/pull/*/merge remote refs that are already merged with the target branch.

Thanks for the info, I missed the additional "merge" in the ref.

@MartinNowak
Copy link
Member Author

We're now testing vibe.d 0.8.1-rc.2 with the mangling dependency gone.
Should we still merge this story into stable for 2.076.0 (2017-09-01) @rainers? Beta began 2 days ago.
FWIW all the necessary druntime changes are in, right?

@wilzbach
Copy link
Member

Should we still merge this story into stable for 2.076.0 (2017-09-01)

AFAIK was vibe.d release the only thing blocking this from being merged.
@MartinNowak: I think it's your call. IIRC you want to keep the release schedule more firmly and this story could potentially disrupt it, but there's also a huge gain from it.

In any case, let's finally merge this into master :)

@MartinNowak MartinNowak changed the base branch from master to stable August 17, 2017 12:51
@quickfur
Copy link
Member

Yes, let's merge this into master! Can't wait...

@rainers
Copy link
Member

rainers commented Aug 17, 2017

Should we still merge this story into stable for 2.076.0 (2017-09-01) @rainers?

Two weeks is probably too short for proper exposure, so master should be fine. I guess those interested in this most have no trouble building it themselves or using dmd nightly.

@quickfur
Copy link
Member

I've been checking out the branch separately and rebasing on master locally. Works beautifully, if only a bit inconveniently because every time I update git master I have to manually rebase. It will be much easier once this is merged into master. Also, it will allow more people to give it the testing it needs before we ship it with a release, on the off-chance that some remote corner-case causes a regression.

@MartinNowak MartinNowak changed the base branch from stable to master August 18, 2017 11:05
@dlang-bot dlang-bot merged commit 0474998 into dlang:master Aug 18, 2017
@MartinNowak MartinNowak deleted the merge_mangle branch August 18, 2017 14:01
@quickfur
Copy link
Member

WOOOHOOOO!! Finally, this is in!

Big thanks to everyone involved in the effort in fixing this issue. Special kudos to @rainers for a totally awesome implementation.

@rainers
Copy link
Member

rainers commented Aug 18, 2017

Let's hope it lives up to the expectations.

Thanks everyone helping to get this through the different CI hosts and finally merged (after more than a year). This raises hope for the precise GC, too (the original PR is open for almost 3 years, but rebooted last year dlang/druntime#1603).

@quickfur
Copy link
Member

I've been using the mangle branch before it was merged to master for my template-heavy project for the past 2 weeks or so. Rebased it multiple times on git HEAD as new PRs were merged into master. So far, I have not seen any problems, and it has helped keep my executable sizes sane (~4MB for 2 executables, instead of 63MB and 186MB(!) respectively, without the mangle branch).

@quickfur
Copy link
Member

Hopefully other template-heavy projects will see similar improvements too.

@quickfur
Copy link
Member

Tested the latest dmd on some of my other D projects. Overall trend is a decrease in executable size. The size reductions are generally less dramatic for non-template-heavy code, but for template-heavy code, dramatic gains similar to what I mentioned are noted. For example, dcal saw a reduction from about 7-8 MB to 1.9MB, which is roughly a 3x-4x reduction. The amount of reduction roughly correlates with how template-heavy the code is, as is to be expected.

I did not observe any increases in executable sizes except in a few very old projects that I'm guessing are not valid data points, because I may have run strip and/or upx on them the last time I built them.

@ibuclaw
Copy link
Member

ibuclaw commented Dec 22, 2020

I've lodged the change to fail12485.d as a regression https://issues.dlang.org/show_bug.cgi?id=21499

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants