Page MenuHomePhabricator

danlark (Danila Kutenin)
User

Projects

User does not belong to any projects.

User Details

User Since
Nov 10 2017, 11:52 PM (290 w, 5 d)

Recent Activity

Today

danlark added a comment to D152152: [mlir][sparse] Fix strict weak ordering in sorting.

In practice if there are more than 30 elements, it could and can (for example, by being a pivot and waiting for the false condition): https://stackoverflow.com/questions/38966516/should-sorting-algorithm-pass-same-element-in-the-comparison-function

I understand the general requirement for sort, but this sort is only used in particular situations by the sparse compiler. So my question is, do you have a test case that would trigger the assert at L35.
If so, we would like to understand the example code before removing the assert.

Thu, Jun 8, 6:34 AM · Restricted Project, Restricted Project

Tue, Jun 6

danlark added a comment to D152152: [mlir][sparse] Fix strict weak ordering in sorting.

Is there any change to the std::sort that requires such a change? In these two particular cases, there should not be any duplicated item from the array (otherwise, it leads to logical bugs).

std::sort is allowed to call comparator on the same element.

But do you have a example that trigger this? The sparse compiler has a non-dup property, and we would like to see the example that leads to this?

Tue, Jun 6, 4:20 AM · Restricted Project, Restricted Project

Mon, Jun 5

danlark added a comment to D152152: [mlir][sparse] Fix strict weak ordering in sorting.

Is there any change to the std::sort that requires such a change? In these two particular cases, there should not be any duplicated item from the array (otherwise, it leads to logical bugs).

Mon, Jun 5, 2:59 PM · Restricted Project, Restricted Project
danlark requested review of D152152: [mlir][sparse] Fix strict weak ordering in sorting.
Mon, Jun 5, 6:31 AM · Restricted Project, Restricted Project

Sun, Jun 4

danlark added a comment to D150264: [libcxx] Add strict weak ordering checks to sorting algorithms.

I don't have commit rights, can you help me submit the change?

Danila Kutenin
kutdanila@yandex.ru

I tried to land this patch on your behalf, but there are some merge conflicts. Can you rebase the patch on main?

Sun, Jun 4, 7:37 AM · Restricted Project, Restricted Project, Restricted Project
danlark updated the diff for D150264: [libcxx] Add strict weak ordering checks to sorting algorithms.

Rebase to head

Sun, Jun 4, 7:36 AM · Restricted Project, Restricted Project, Restricted Project

Fri, Jun 2

danlark added a comment to D150264: [libcxx] Add strict weak ordering checks to sorting algorithms.

Ping

Fri, Jun 2, 10:26 AM · Restricted Project, Restricted Project, Restricted Project

Tue, May 30

danlark added a comment to D150264: [libcxx] Add strict weak ordering checks to sorting algorithms.

I don't have commit rights, can you help me submit the change?

Tue, May 30, 5:44 AM · Restricted Project, Restricted Project, Restricted Project

Thu, May 25

danlark added a comment to D150264: [libcxx] Add strict weak ordering checks to sorting algorithms.

Ping

Thu, May 25, 5:07 AM · Restricted Project, Restricted Project, Restricted Project

Mon, May 22

danlark added a comment to D150264: [libcxx] Add strict weak ordering checks to sorting algorithms.

Ping

Mon, May 22, 12:12 AM · Restricted Project, Restricted Project, Restricted Project

Tue, May 16

danlark updated the diff for D150264: [libcxx] Add strict weak ordering checks to sorting algorithms.

Fix comments

Tue, May 16, 2:41 AM · Restricted Project, Restricted Project, Restricted Project

Mon, May 15

danlark updated the diff for D150264: [libcxx] Add strict weak ordering checks to sorting algorithms.

Remove arg policy

Mon, May 15, 2:19 AM · Restricted Project, Restricted Project, Restricted Project
danlark added inline comments to D150264: [libcxx] Add strict weak ordering checks to sorting algorithms.
Mon, May 15, 1:23 AM · Restricted Project, Restricted Project, Restricted Project
danlark updated the diff for D150264: [libcxx] Add strict weak ordering checks to sorting algorithms.

Address comments

Mon, May 15, 1:23 AM · Restricted Project, Restricted Project, Restricted Project

Fri, May 12

danlark updated the diff for D150264: [libcxx] Add strict weak ordering checks to sorting algorithms.

Follow the standard library lint

Fri, May 12, 6:48 AM · Restricted Project, Restricted Project, Restricted Project
danlark updated the diff for D150264: [libcxx] Add strict weak ordering checks to sorting algorithms.

Merge all changes I had about includes and tests

Fri, May 12, 4:47 AM · Restricted Project, Restricted Project, Restricted Project
danlark updated the diff for D150264: [libcxx] Add strict weak ordering checks to sorting algorithms.

Fix incorrect tests and ADL lookups

Fri, May 12, 3:31 AM · Restricted Project, Restricted Project, Restricted Project

Wed, May 10

danlark updated the diff for D150264: [libcxx] Add strict weak ordering checks to sorting algorithms.

Fix includes

Wed, May 10, 8:02 AM · Restricted Project, Restricted Project, Restricted Project
danlark requested review of D150264: [libcxx] Add strict weak ordering checks to sorting algorithms.
Wed, May 10, 5:59 AM · Restricted Project, Restricted Project, Restricted Project

Mar 29 2023

danlark added a comment to D146421: [release/16.x][libc++] Revert the bitset sort optimization.

Thanks for a thorough response and productive discussion. LGTM

Mar 29 2023, 6:53 AM · Restricted Project, Restricted Project

Mar 28 2023

danlark added a comment to D146421: [release/16.x][libc++] Revert the bitset sort optimization.

Shuffling the range wouldn't help here -- the problem wasn't non-determinism in the output, it's that we literally go and read out-of-bounds when the comparator is wrong. I think this is happening in __insertion_sort_unguarded, and I think I can add an assertion check just in there to "fix" the issue but I haven't had time to get the reproducer integrated in our test suite yet.

Mar 28 2023, 4:30 PM · Restricted Project, Restricted Project

Mar 27 2023

danlark added a comment to D146421: [release/16.x][libc++] Revert the bitset sort optimization.

Also to catch all strict weak ordering bugs, there are O(n^2) algorithms, for example, here. We can introduce a debug check with a square root of elements sampling. Would you be up to do this? Given how long range randomization took, I decided not to go into that direction as it seemed even harder to introduce safely. I can prioritize this work if there will be enough support from the maintainers

Mar 27 2023, 1:23 PM · Restricted Project, Restricted Project
danlark added a comment to D146421: [release/16.x][libc++] Revert the bitset sort optimization.

To catch most issues, we introduced __debug_randomize_range which is present on line 973 on the left. That can be advised to run tests. We found most out of bound bugs at Google with randomization of the input

Mar 27 2023, 1:17 PM · Restricted Project, Restricted Project

Jan 9 2023

danlark added inline comments to D141205: [libcxx] nth_element use introselect to avoid quadratic behavior.
Jan 9 2023, 5:33 AM · Restricted Project, Restricted Project

Jan 8 2023

danlark added inline comments to D141205: [libcxx] nth_element use introselect to avoid quadratic behavior.
Jan 8 2023, 9:04 AM · Restricted Project, Restricted Project

Dec 21 2022

danlark added a comment to D123720: [VPlan] Replace use of needsVectorIV with VPlan user check..

Hi @fhahn, this is the first commit that caused a miscompilation we observed.

Dec 21 2022, 5:17 PM · Restricted Project, Restricted Project

Apr 3 2022

danlark added a comment to D122941: [libc++] Make the Debug mode a configuration-time only option.

@danlark
This patch will break users of the randomized unspecified behavior you added since you are most likely not shipping a debug-mode version of the library today. Has it been in used internally at Google?

Thanks for adding me.

I confirm we haven't shipped anything with randomization to the (external) users and this patch should be fine with us as we build everything from source

Just to make sure we're on the same page, here's what this change entails if you've been using randomization (even just internally): Out-of-the-box, you'll get a compiler error saying that you're using unspecified behavior randomization with a library that has been built without the debug mode. You'll need to switch to building the library with the debug mode enabled, i.e. LIBCXX_ENABLE_DEBUG_MODE=ON when configuring in CMake. However, that will also cause all the other debug mode checks to be enabled, which you may or may not want. And there will certainly be a slowdown associated to this, too. Is that fine, or do we need to make it possible to use unspecified behavior randomization without using the rest of the debug mode from the get-go? If that's a requirement for you, I'll try to think about ways to make that possible in this version of the patch and keep you up-to-date. If not, that makes my life easier since I can land this and then relax requirements once we've agreed on a design document (aiming to make it happen this week).

Apr 3 2022, 8:42 AM · Restricted Project, Restricted Project
danlark added a comment to D122941: [libc++] Make the Debug mode a configuration-time only option.

Another thought: Should we change the ABI namespace to force link time errors if someone tries to link against the wrong library? - This should probably be done in the same patch where we enable some ABI flags.

We are very much on the same page, it seems :-). Quoting from my in-progress design document:

  • The sanitized version of the library would have a different name, for example libc++-sanitized.dylib. A different __config_site file would also be provided to be used when compiling code against the sanitized library. Vendors could ship both the sanitized and the non-sanitized library side-by-side.
  • The sanitized version of the library would use a different inline namespace to make sure that code can’t accidentally link against the wrong version of the library (which would result in runtime errors due to ABI incompatibilities).
  • When -fsanitize=library is passed to the compiler, the compiler would automatically switch to using the sanitized version of the library. It would use the sanitized shared library as well as the sanitized version of the __config_site header, so that code in the headers would be built with sanitization enabled too.

I will also treat the topic of ABI compatibility between sanitized and non-sanitized versions, and also ABI stability between sanitized versions. Stay tuned, I should post it to Discourse in a couple of days.

@danlark
This patch will break users of the randomized unspecified behavior you added since you are most likely not shipping a debug-mode version of the library today. Has it been in used internally at Google?

Apr 3 2022, 8:09 AM · Restricted Project, Restricted Project

Dec 20 2021

danlark added a reviewer for D116037: [clang-include-fixer] Fix incorrect ranking because of dangling references: bkramer.
Dec 20 2021, 5:54 AM · Restricted Project
danlark updated the summary of D116037: [clang-include-fixer] Fix incorrect ranking because of dangling references.
Dec 20 2021, 5:48 AM · Restricted Project
danlark requested review of D116037: [clang-include-fixer] Fix incorrect ranking because of dangling references.
Dec 20 2021, 5:48 AM · Restricted Project

Nov 16 2021

danlark updated the diff for D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.

Fix CI and linter

Nov 16 2021, 11:33 AM · Restricted Project
danlark added inline comments to D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.
Nov 16 2021, 7:35 AM · Restricted Project
danlark updated the diff for D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.

Remove the ifdef for __libcpp_debug_randomizer

Nov 16 2021, 7:35 AM · Restricted Project
danlark added inline comments to D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.
Nov 16 2021, 7:24 AM · Restricted Project
danlark updated the diff for D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.

I hope this is the last update

Nov 16 2021, 7:23 AM · Restricted Project
danlark updated the diff for D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.

Improve the library build support

Nov 16 2021, 6:55 AM · Restricted Project
danlark updated the diff for D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.
Nov 16 2021, 5:23 AM · Restricted Project

Nov 15 2021

danlark updated the diff for D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.
Nov 15 2021, 6:22 PM · Restricted Project
danlark updated the diff for D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.

Improve one comment

Nov 15 2021, 5:06 PM · Restricted Project
danlark updated the diff for D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.
Nov 15 2021, 4:56 PM · Restricted Project
danlark added a comment to D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.

All comments are done

Nov 15 2021, 4:55 PM · Restricted Project
danlark updated the diff for D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.
Nov 15 2021, 4:54 PM · Restricted Project

Nov 11 2021

danlark added a comment to D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.

@ldionne call of last hope, if I should continue the effort :)

Nov 11 2021, 9:22 AM · Restricted Project

Oct 29 2021

danlark added a comment to D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.

Hi, is this still going and are you interested? I see https://reviews.llvm.org/D93233 and this infrastructure will help all users to migrate and avoid Hyrum's Law dependencies if they see problems

Oct 29 2021, 5:25 AM · Restricted Project

Aug 19 2021

danlark accepted D108354: Use v16i8 rather than v2i64 as the VT for memset expansion on AArch64..

Thanks, LGTM!

Aug 19 2021, 1:32 AM · Restricted Project

May 15 2021

danlark abandoned D102550: [ValueTracking] Mark GEP operand as nonnull if the result was loaded or stored.

I basically agree with @nikic here.
There is a huge number of low-hanging fruit like this,
but the approach just doesn't seem viable to me.

I would instead like to see the Attributor finally enabled,
there such things would be much more straight-forward.

Sorry for a very not helpful feedback.

May 15 2021, 9:47 AM · Restricted Project
danlark added a comment to D102550: [ValueTracking] Mark GEP operand as nonnull if the result was loaded or stored.

I'm somewhat concerned about the general direction here. This looks through a GEP, but what about bitcasts? What about a bitcast of a GEP? A GEP of a bitcast? A longer chain of GEPs and bitcasts? We can't reasonably walk the whole use graph and this is really pushing the bounds of what it appropriate for a ValueTracking helper.

We have a more principled version of this optimization in LVI, which scans whole blocks for pointer dereferences and records their underlying objects, thus handling this in full generality. The only caveat is that LVI only uses this information to optimize the terminator instruction, because it does not store where exactly inside the block the first dereference occurs. If the motivation here is handling of non-terminator comparisons, then that might be a better avenue to explore?

May 15 2021, 8:56 AM · Restricted Project
danlark updated the diff for D102550: [ValueTracking] Mark GEP operand as nonnull if the result was loaded or stored.

Fix compilation issues

May 15 2021, 8:45 AM · Restricted Project
danlark updated the diff for D102550: [ValueTracking] Mark GEP operand as nonnull if the result was loaded or stored.

Remove unnecessary checks

May 15 2021, 8:44 AM · Restricted Project
danlark updated the diff for D102550: [ValueTracking] Mark GEP operand as nonnull if the result was loaded or stored.

Fix clang-tidy warning

May 15 2021, 6:13 AM · Restricted Project
danlark added inline comments to D102550: [ValueTracking] Mark GEP operand as nonnull if the result was loaded or stored.
May 15 2021, 4:32 AM · Restricted Project
danlark updated the diff for D102550: [ValueTracking] Mark GEP operand as nonnull if the result was loaded or stored.

Don't compute isKnownNonZero for operand

May 15 2021, 4:31 AM · Restricted Project
danlark added inline comments to D102550: [ValueTracking] Mark GEP operand as nonnull if the result was loaded or stored.
May 15 2021, 4:20 AM · Restricted Project
danlark added inline comments to D102550: [ValueTracking] Mark GEP operand as nonnull if the result was loaded or stored.
May 15 2021, 4:18 AM · Restricted Project
danlark updated the diff for D102550: [ValueTracking] Mark GEP operand as nonnull if the result was loaded or stored.

Add gep after check test to test DominatorTree

May 15 2021, 4:15 AM · Restricted Project
danlark updated the summary of D102550: [ValueTracking] Mark GEP operand as nonnull if the result was loaded or stored.
May 15 2021, 4:04 AM · Restricted Project
danlark requested review of D102550: [ValueTracking] Mark GEP operand as nonnull if the result was loaded or stored.
May 15 2021, 4:03 AM · Restricted Project
danlark abandoned D83547: [builtins] Optimize the 128-bit division according to "Improved division by invariant integers" paper.
May 15 2021, 2:48 AM · Restricted Project
danlark abandoned D84497: [builtins][NFC] Replace the constants better matching readability in udivmodti4.
May 15 2021, 2:36 AM · Restricted Project
danlark updated the summary of D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.
May 15 2021, 2:05 AM · Restricted Project

May 14 2021

danlark added a comment to D102502: [clang] Fix ternary operator in the second for loop statement.

Failure looks unrelated, please submit as I don't have commit rights

May 14 2021, 4:16 PM · Restricted Project
danlark updated the diff for D102502: [clang] Fix ternary operator in the second for loop statement.
  • Address comment from Richard
May 14 2021, 2:37 PM · Restricted Project
danlark added a comment to D102502: [clang] Fix ternary operator in the second for loop statement.

Thanks, nice catch!

Can we also add an assert when parsing a for statement that we actually find a range if the tentative parse said we were expecting one?

May 14 2021, 2:15 PM · Restricted Project
danlark updated the diff for D102502: [clang] Fix ternary operator in the second for loop statement.
  • Add assert of finding a for range declaration
May 14 2021, 2:15 PM · Restricted Project
danlark added inline comments to D102502: [clang] Fix ternary operator in the second for loop statement.
May 14 2021, 1:02 PM · Restricted Project
danlark updated the diff for D102502: [clang] Fix ternary operator in the second for loop statement.
  • Add codegen and AST tests
May 14 2021, 1:02 PM · Restricted Project
danlark retitled D102502: [clang] Fix ternary operator in the second for loop statement from [clang] Fix ternary operator in second for loop statement to [clang] Fix ternary operator in the second for loop statement.
May 14 2021, 1:02 PM · Restricted Project
danlark retitled D102502: [clang] Fix ternary operator in the second for loop statement from [clang] Fix ternary operator in second for loop argument to [clang] Fix ternary operator in second for loop statement.
May 14 2021, 1:02 PM · Restricted Project
danlark added a reviewer for D102502: [clang] Fix ternary operator in the second for loop statement: lebedev.ri.
May 14 2021, 9:15 AM · Restricted Project
danlark added a comment to D102502: [clang] Fix ternary operator in the second for loop statement.

Done, please, take a look

May 14 2021, 9:15 AM · Restricted Project
danlark updated the diff for D102502: [clang] Fix ternary operator in the second for loop statement.
  • Add codegen and AST tests
May 14 2021, 9:15 AM · Restricted Project
danlark updated the diff for D102502: [clang] Fix ternary operator in the second for loop statement.
  • Add codegen test
May 14 2021, 9:07 AM · Restricted Project
danlark added a comment to D102502: [clang] Fix ternary operator in the second for loop statement.

This should have codegen, and maybe AST, tests.

May 14 2021, 8:45 AM · Restricted Project
danlark requested review of D102502: [clang] Fix ternary operator in the second for loop statement.
May 14 2021, 8:30 AM · Restricted Project

May 4 2021

danlark added a comment to D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.

Sorry for not pinging for so long

May 4 2021, 2:50 PM · Restricted Project

Feb 19 2021

danlark abandoned D97000: [clang] Increase the bitness of data length in ASTDeclContextNameLookup.

Thanks!

Feb 19 2021, 12:17 AM · Restricted Project

Feb 18 2021

danlark updated the summary of D97000: [clang] Increase the bitness of data length in ASTDeclContextNameLookup.
Feb 18 2021, 2:57 PM · Restricted Project
danlark requested review of D97000: [clang] Increase the bitness of data length in ASTDeclContextNameLookup.
Feb 18 2021, 2:53 PM · Restricted Project
danlark added a comment to D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.

First of all, thanks for writing a design document and explaining the purpose of your patch. Let me try to understand the use case a bit better.

So basically, let's say you're trying to adopt a new implementation of std::sort internally. You change that, but then you realize that a bunch of tests break because they were relying on the exact order of equal elements after std::sort, which is really unspecified. But since those tests are failing, you can't use the new std::sort implementation until all the tests have been fixed. So, in order to make that transition easier and allow fixing tests one by one, you add this feature. You then turn it on locally for some projects/tests inside your organization, and you fix them one by one. Once you're done, you can switch the algorithm implementation, and turn off the randomization. Is that the idea?

Feb 18 2021, 9:23 AM · Restricted Project
danlark updated the diff for D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.

Address comments

Feb 18 2021, 9:23 AM · Restricted Project
danlark updated the diff for D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.

Fix unused parameters

Feb 18 2021, 3:27 AM · Restricted Project
danlark updated the summary of D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.
Feb 18 2021, 2:28 AM · Restricted Project
danlark requested review of D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.
Feb 18 2021, 2:25 AM · Restricted Project

Feb 4 2021

danlark added inline comments to D93661: [libc++] [P0879] constexpr std::sort, and add new tests for it.
Feb 4 2021, 11:27 AM · Restricted Project
danlark added inline comments to D93661: [libc++] [P0879] constexpr std::sort, and add new tests for it.
Feb 4 2021, 9:28 AM · Restricted Project

Jul 24 2020

danlark updated the diff for D84497: [builtins][NFC] Replace the constants better matching readability in udivmodti4.

Correctness

Jul 24 2020, 1:03 AM · Restricted Project
Herald added a project to D84497: [builtins][NFC] Replace the constants better matching readability in udivmodti4: Restricted Project.
Jul 24 2020, 12:58 AM · Restricted Project

Jul 10 2020

danlark planned changes to D83547: [builtins] Optimize the 128-bit division according to "Improved division by invariant integers" paper.

I need to double check the cold cache performance, it may happen that it is slower in that case

Jul 10 2020, 6:38 AM · Restricted Project
danlark added a reviewer for D83547: [builtins] Optimize the 128-bit division according to "Improved division by invariant integers" paper: howard.hinnant.
Jul 10 2020, 5:57 AM · Restricted Project
danlark updated the diff for D83547: [builtins] Optimize the 128-bit division according to "Improved division by invariant integers" paper.

Provide better names than in paper

Jul 10 2020, 5:55 AM · Restricted Project
danlark added a comment to D83547: [builtins] Optimize the 128-bit division according to "Improved division by invariant integers" paper.

I have no idea what the policy is WRT size for compiler-rt. How big is the diff if you take code size into consideration ?

Jul 10 2020, 5:46 AM · Restricted Project
danlark updated the summary of D83547: [builtins] Optimize the 128-bit division according to "Improved division by invariant integers" paper.
Jul 10 2020, 5:35 AM · Restricted Project
Herald added a project to D83547: [builtins] Optimize the 128-bit division according to "Improved division by invariant integers" paper: Restricted Project.
Jul 10 2020, 5:34 AM · Restricted Project
danlark updated the diff for D81809: [builtins] Optimize udivmodti4 for many platforms..

Fix clang format

Jul 10 2020, 12:55 AM · Restricted Project
danlark updated the diff for D81809: [builtins] Optimize udivmodti4 for many platforms..

Fix comments

Jul 10 2020, 12:43 AM · Restricted Project

Jul 9 2020

danlark added a comment to D81809: [builtins] Optimize udivmodti4 for many platforms..

Please, take a look

Jul 9 2020, 2:06 PM · Restricted Project

Jul 8 2020

danlark updated the diff for D81809: [builtins] Optimize udivmodti4 for many platforms..

Update the real reference

Jul 8 2020, 11:45 AM · Restricted Project
danlark closed D83027: Add benchmarks for 128 bit division and create a directory for all builtins benchmarks.

879f4962e83f98863c83e385e956d579e131791f

Jul 8 2020, 12:56 AM

Jul 7 2020

danlark updated the diff for D81809: [builtins] Optimize udivmodti4 for many platforms..

Fix comments

Jul 7 2020, 11:33 PM · Restricted Project