Re: [PATCH] Fix biased shuffle by avoiding already "struck" elements

2024-07-09 Thread Sergei Trofimovich
On Fri, 21 Jun 2024 11:36:16 -0400 Dmitry Goncharov wrote: > On Fri, Jun 21, 2024 at 10:30 AM Paul Smith wrote: > > > > On Fri, 2024-06-21 at 09:11 -0400, Dmitry Goncharov wrote: > > > i hope, Paul approves adding tests of this nature. > > > > I have no problems with adding unit tests, as lo

Re: [PATCH] Fix biased shuffle by avoiding already "struck" elements

2024-06-19 Thread Sergei Trofimovich
On Wed, 19 Jun 2024 10:55:53 -0400 Dmitry Goncharov wrote: > On Tue, Jun 18, 2024 at 5:38 PM Sergei Trofimovich wrote: > > After the change probabilities are not as biased: > > > > 0 1 2 3 > > _ _ _ _ > > 0 |

[PATCH] Fix biased shuffle by avoiding already "struck" elements

2024-06-18 Thread Sergei Trofimovich
From: Sergei Trofimovich Artem Klimov noticed that current shuffle implementation suffers from probability bias due to a typical bug in the shuffling implementation. When we consider already shuffled element we slightly bias their propability. https://en.wikipedia.org/wiki/Fisher%E2%80

[bug #63098] make-4.3.90 regression of unexpected dependencies in pattern rules with multiple targets

2022-09-23 Thread Sergei Trofimovich
Follow-up Comment #3, bug #63098 (project make): Aha, behavior change makes sense. Let's close it as intended then. Looks like opensp's case is even more nuanced. `%.h %.cxx %.rc: %.msg` produces `.cxx` files only for a subset of `.msg` files: `.cxx` generation happens only where file contents ha

[bug #63098] make-4.3.90 regression of unexpected dependencies in pattern rules with multiple targets

2022-09-23 Thread Sergei Trofimovich
elease: None Triage Status: None ___ Follow-up Comments: --- Date: Fri 23 Sep 2022 07:05:25 PM UTC By: Sergei Trofimovich Initially noticed the problem in OpenSP-1.5.2 build f

[bug #63047] --shuffle mode does not work on .SECONDEXPANSION targets

2022-09-11 Thread Sergei Trofimovich
Follow-up Comment #1, bug #63047 (project make): Posted the patch for review as https://lists.gnu.org/archive/html/bug-make/2022-09/msg00069.html ___ Reply to this item at: ___

[bug #63047] --shuffle mode does not work on .SECONDEXPANSION targets

2022-09-11 Thread Sergei Trofimovich
Additional Item Attachment, bug #63047 (project make): File name: 0001-Fix-shuffle-for-SECONDEXPANSION-prerequisites.patch Size:3 KB __

[PATCH] Fix --shuffle for SECONDEXPANSION prerequisites

2022-09-11 Thread Sergei Trofimovich
From: Sergei Trofimovich Since commit 07eea3aa4 ("[SV 62706] Only second-expand targets that might be built") `make --shuffle` stopped shuffling prerequisites that use .SECONDEXPANSION feature for Makefiles like: .SECONDEXPANSION: all: $$(var) %_: ; @echo $@ var

[bug #63047] --shuffle mode does not work on .SECONDEXPANSION targets

2022-09-11 Thread Sergei Trofimovich
Status: None ___ Follow-up Comments: --- Date: Sun 11 Sep 2022 08:13:12 PM UTC By: Sergei Trofimovich Since commit 07eea3aa496184bb763b7306e9de6a40a94605c9 ("[SV 62706] Only second-exp

[bug #63040] autoconf-2.69 and 2.71 fail to build after $(shell ...) environment handlign change

2022-09-09 Thread Sergei Trofimovich
Follow-up Comment #1, bug #63040 (project make): Proposed possible fix for autoconf as https://lists.gnu.org/archive/html/autoconf-patches/2022-09/msg7.html ___ Reply to this item at:

[bug #63040] autoconf-2.69 and 2.71 fail to build after $(shell ...) environment handlign change

2022-09-09 Thread Sergei Trofimovich
: None Triage Status: None ___ Follow-up Comments: --- Date: Fri 09 Sep 2022 10:35:02 AM UTC By: Sergei Trofimovich Tried to use `make` from today's

[bug #62100] [PATCH] Add '--shuffle' argument support

2022-05-22 Thread Sergei Trofimovich
Additional Item Attachment, bug #62100 (project make): File name: v7-0001-Add-shuffle-argument-support.patch Size:35 KB ___ Reply to this it

[bug #62100] [PATCH] Add '--shuffle' argument support

2022-05-22 Thread Sergei Trofimovich
Follow-up Comment #6, bug #62100 (project make): Adding a v7-0001-Add-shuffle-argument-support.patch which 2 extra changes: 1. fixed 'if' indentation in src/main.c noticed by Fangrui Song 2. tweaked --help output to '--shuffle[={SEED|random|identity|reverse|none}]' noticed by Fangrui Song __

[bug #62100] [PATCH] Add '--shuffle' argument support

2022-05-03 Thread Sergei Trofimovich
Follow-up Comment #4, bug #62100 (project make): Caught bugs in a few upstream projects. Two nice simple examples: - vim: https://github.com/vim/vim/pull/9978 - groff: https://savannah.gnu.org/bugs/?62084 ___ Reply to this item at:

[bug #62100] [PATCH] Add '--shuffle' argument support

2022-03-11 Thread Sergei Trofimovich
Follow-up Comment #3, bug #62100 (project make): Uploaded v6-0001-Add-shuffle-argument-support.patch. It's the rebased v5 against today's make.git where a small merge conflict is fixed around added option. Otherwise identical to v5. ___ Rep

[bug #62100] [PATCH] Add '--shuffle' argument support

2022-03-11 Thread Sergei Trofimovich
Additional Item Attachment, bug #62100 (project make): File name: v6-0001-Add-shuffle-argument-support.patch Size:35 KB ___ Reply to this it

[bug #62100] [PATCH] Add '--shuffle' argument support

2022-02-23 Thread Sergei Trofimovich
Follow-up Comment #1, bug #62100 (project make): Changes from v4: presence of `.NOTPARALLEL:` target disables shuffling as makefile is already known to be broken in target reorder caused by -j parallelism. Example of real package is `netpbm`. Upstream does not plan to fix it. ___

[bug #62100] [PATCH] Add '--shuffle' argument support

2022-02-23 Thread Sergei Trofimovich
Additional Item Attachment, bug #62100 (project make): File name: v5-0001-Add-shuffle-argument-support.patch Size:35 KB ___ Reply to this it

[bug #62100] [PATCH] Add '--shuffle' argument support

2022-02-22 Thread Sergei Trofimovich
URL: Summary: [PATCH] Add '--shuffle' argument support Project: make Submitted by: slyfox Submitted on: Wed 23 Feb 2022 07:51:47 AM UTC Severity: 3 - Normal Item Group:

Re: [PATCH] Fix src/function.c build failure on gcc-12.

2022-02-22 Thread Sergei Trofimovich
On Mon, 21 Feb 2022, 15:29 Paul Smith, wrote: > > On Mon, 2022-02-21 at 08:59 +, Edward Welbourne wrote: > > and that's assuming a 32-bit int; the signed range is from - > > 2,147,483,647 to 2,147,483,648. However, may I suggest the following > > (which I know included in the GPL'd cfengine s

[PATCH v4] Add '--shuffle' argument support

2022-02-20 Thread Sergei Trofimovich
On Sun, Feb 20, 2022 at 10:30:10AM +, Sergei Trofimovich wrote: > On Sat, Feb 19, 2022 at 09:57:13AM +0200, Eli Zaretskii wrote: > > I think NEWS should also call out the new feature. Forgot the actual NEWS entry. Attached v4. -- Sergei >From 6eb8c759f6e917ff82326769e509505f

Re: [PATCH v2] Add '--shuffle' argument support

2022-02-20 Thread Sergei Trofimovich
r one. Dropped a TODO as it's no worse than naive recursion in update_file_1. > > --- /dev/null > > +++ b/tests/scripts/options/shuffle-reverse > > This test doesn't seem to test the random option. I understand why > this is not easy, but shouldn't it still be tested,

make re-exec regression in 'make -sf -' mode

2022-02-19 Thread Sergei Trofimovich
Noticed the regression on lowdown-0.10.0 upstream package. Here is a complete trigger: $ printf 'all:\n\techo $(CC)' | make -sf - [good] GNU make 4.3 works as expected: $ printf 'all:\n\techo $(CC)' | make -sf - cc [bad] GNU make from git loops indefinitely in re-execution: $

Re: [PATCH] RFC: add --shuffle[=seed] argument support

2022-02-18 Thread Sergei Trofimovich
On Sun, 6 Feb 2022 09:34:22 + Sergei Trofimovich wrote: > On Sat, 05 Feb 2022 18:39:41 -0500 > Paul Smith wrote: > > > Nice work! > > > > On Sat, 2022-02-05 at 22:04 +, Sergei Trofimovich wrote: > > > Some high level TODOs: > > >

[PATCH v2] Add '--shuffle' argument support

2022-02-18 Thread Sergei Trofimovich
From: Sergei Trofimovich The idea of the change is to introduce non-deterministic ordering into goal and prerequisite traversal to imitate non-deterministic ordering of 'make -j g1 g2 g3' mode. The implementation is to introduce second order into each dependency chain: 1. existin

[PATCH] Fix src/function.c build failure on gcc-12.

2022-02-18 Thread Sergei Trofimovich
From: Sergei Trofimovich Upcoming gcc-12 detects possible buffer overflow for 1 byte: src/function.c: In function 'func_call': src/function.c:2781:24: error: '__builtin___sprintf_chk' may write a terminating nul past the end of the destination [-Werror=format-o

Re: [PATCH] RFC: add --shuffle[=seed] argument support

2022-02-06 Thread Sergei Trofimovich
On Sat, 05 Feb 2022 18:39:41 -0500 Paul Smith wrote: > Nice work! > > On Sat, 2022-02-05 at 22:04 +0000, Sergei Trofimovich wrote: > > Some high level TODOs: > > For this amount of change it's likely that you'll need to provide > copyright assignment pap

[PATCH] RFC: add --shuffle[=seed] argument support

2022-02-05 Thread Sergei Trofimovich
The idea of the change is to introduce non-deterministic ordering into goal and prerequisite traversal to imitate non-deterministic ordering of 'make -j' mode. The implementation is to reorder lists of goals to build and list of dependencies attached to files reachable via goals. tested on the fo

Re: Idea of triggering bugs in users' Makefiles

2022-02-04 Thread Sergei Trofimovich
On Fri, 04 Feb 2022 10:27:01 -0500 Paul Smith wrote: > On Fri, 2022-02-04 at 09:13 +0000, Sergei Trofimovich wrote: > > 1. Enable parallel builds by GNU make by default > > > > 2. Do not run dependencies in deterministic order by default: > > GNU make (unlike N

Idea of triggering bugs in users' Makefiles

2022-02-04 Thread Sergei Trofimovich
Individual developers more often than not build large projects in parallel to speed the process up with 'make -j '. OS distributions would also prefer to enable parallel builds by default. But there is a problem of deciding if it's safe to build a package in general. In small projects developers