🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #30

Re: [PATCH 0/4] faster SHA-1 collision detection

#30
From: Junio C Hamano
Date: Wed, 07 Oct 2026 17:23
45 lines
11583 bytes
Scott Chacon <scott@gitbutler.net> writes:

> So, spoiler alert, the code in this patch series is mainly AI generated.
> I would try to fool you, but too many of you are far too aware of my
> actual C skills. That being said, I thought maybe someone here (especially
> those of you working on server optimization stuff) would be interested
> in the speed increases for both the server and client in making sha1dc
> quite a bit faster.
>
> This series ports the approach of Sam Reis's sha1dc Rust crate [1], 
> which gitoxide recently switched to [2], to C. 

Which means license-wise the original is compatible with us, I
presume, as they are "Apache2 or MIT, your choice".

How can you/we be sure, with respect to the current AI policy in
SubmittingPatches (which by the way was vetted by SFC lawyers), that
your "AI generated" code did not "borrow" from places that gets
you/us into trouble?

> The end result hashes roughly 2.7x faster on the Xeon and 2.85x faster
> on the M5 Max. Single-threaded index-pack of git.git goes from 24.3s to
> 12.7s on the Xeon, and from 16.1s to 8.7s on the M5 Max.
>
> Hashing throughput on the Xeon, in MiB/s:
>
>                                 16KiB    1MiB   vs OpenSSL
>   OpenSSL SHA-1 (no detection)   1234    1129      1.00x
>   sha1dc/ (today)                 435     450      2.67x
>   shani+avx2 (default here)      1002     901      1.24x
>   shani+sse2                     1075    1008      1.13x
>   portable+avx2                   553     654      1.96x
>   portable+sse2                   603     681      1.84x
>   portable                        466     565      2.29x
>
> In other words, currently collision detection costs about 1.5–2.5x on
> top of the hashing itself today, but only about 0.2x with the series. 

Thanks for these numbers.

> [1] https://sam.dev/blog/faster-sha1-collision-detection
> [2] https://github.com/GitoxideLabs/gitoxide/pull/3008

And the pointers to the original sources.
Technical Details
Message-ID: <xmqq5wzda0h6.fsf@gitster.g>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-71382-linux-kernel-git=dewy.ru
References: <20260929112544.86511-1-scott@gitbutler.net>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-71382-linux-kernel-git=dewy.ru
From: gitster@pobox.com (Junio C Hamano)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH 0/4] faster SHA-1 collision detection
Date: Wed, 07 Oct 2026 10:23:33 -0700
Organization: Usenet Network
Message-ID: <xmqq5wzda0h6.fsf@gitster.g>
References: <20260929112544.86511-1-scott@gitbutler.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="695222"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:bU+SiW4hwmskJvXlPAzsXSkPxPs= sha256:FdLIls0BLyInLxWCjRUHkcAHZmSpbWfyAkZB26+NpEA=
	sha1:6naF2B/FOU3qPiuu1XkgttPpvis= sha256:8vOCC1oZtL4JB5HC6kF8678dvwWYxd1lwBDMONsuKF0=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id AAAA010F1BD; Wed,  7 Oct 2026 20:23:55 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=pobox.com header.b=PCMmAfCo; dkim=pass (2048-bit key)
	header.d=messagingengine.com header.b=IF1wiqhv
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id TJ2K5MHuV_vy;
	Wed,  7 Oct 2026 20:23:47 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-71382-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=pobox.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 6F26810F1AA; Wed,  7 Oct 2026 20:23:42 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id F25D72BE00; Wed,  7 Oct 2026 17:23:39 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 80A4F3DDDDD;
	Wed,  7 Oct 2026 17:23:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b="PCMmAfCo";
	dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="IF1wiqhv"
X-Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE7F93D669C
	for <git@vger.kernel.org>; Wed,  7 Oct 2026 17:23:35 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791393817; cv=none; b=Wul6ppT8XEBy40n9sTiP2MP9dQzeb2QUV4A7alamQCX2LTNhCaPQrbr/HYU735W2yGk8lDnGNbIGxEWOtnduNE+hf8Sl28MSg//gmuqCuD3/tY9TH67gTDRkqOuxMFWv6HGghERsv5C0zR3ytrvlWNUqvLDT1/Var43o2nyjpwU=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791393817; c=relaxed/simple;
	bh=34Y2pg4DngiFfkG1kptkGhv0GlQuddEi3RK8Zpu8Ln4=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 MIME-Version:Content-Type; b=PBuHGqAm19yJ8ZipNAhkfZ+e9pOZI/7lSfWWONZKfjLzUQaeVcCOcj+y2tODwePWRQBZfnyZw4er0Gamz5Itnpd9A+RvEX+UQgXb6j2V4baaPyPhv55H1rgHVToht4CFFCi/rqUp0kxlvu3+5g7pVeMEcHDde4xtoK+DE3AZU3E=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=PCMmAfCo; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=IF1wiqhv; arc=none smtp.client-ip=103.168.172.157
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com
X-Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51])
	by mailfhigh.phl.internal (Postfix) with ESMTP id 2B2541400175
	for <git@vger.kernel.org>; Wed,  7 Oct 2026 13:23:35 -0400 (EDT)
X-Received: from phl-frontend-02 ([10.202.2.161])
  by phl-compute-11.internal (MEProxy); Wed, 07 Oct 2026 13:23:35 -0400
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc
	:cc:content-transfer-encoding:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:subject:subject:to:to; s=fm1; t=1791393815;
	 x=1791480215; bh=1SrsQqtoP3WiwEEYEZHm8rA50JC7zaHpb1fk6pUad+o=; b=
	PCMmAfCol4MTn5RgT5kBVwTv3ExNSNqVAqroFYBFosHERUYgcPnDypvhDx62b4/z
	Ngw0bF4LWvd04l8ny15kub0LRFbP9hGyVWGcDvRq/VOV2Q90mQ4g56jn8PmnonVr
	xISm19kS1bmL++JrJkRIICfVV3GM626FcDJ5Wz8tbYaw3+/3/vkkTzQ75kpexjSR
	muMulU/EfyE4j6G5UqD4OrGPVI2GbreDKBsaT62p4hCIrwSF1VZ1hu8vb5evasVq
	Z/05hDTGVbzgCZRaII86Xyo/HgFdnvsl2F3+PhErBPh9HZWwA5fX55mahMUBS9eF
	sWFw0BX1sBkcN3lgD7DioA==
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-transfer-encoding
	:content-type:content-type:date:date:feedback-id:feedback-id
	:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:subject:subject:to:to:x-me-proxy
	:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1791393815; x=
	1791480215; bh=1SrsQqtoP3WiwEEYEZHm8rA50JC7zaHpb1fk6pUad+o=; b=I
	F1wiqhv0omzadPtSzNybF0gBl0BUMsFuBbOXUVtMPncLeBz4xV2/npCD9L4h0Xn1
	pc36eD/4MRo9s3Xx72sN8WwbiVoBflAdEsMP6QXyNpPe/aQQ6Cford4zj1UEPli5
	MshkWUnOq44XqsimfICPiAn6AmFybmXvpJzZCfC7uMNH6hzfYwOeb39RrI8EZfLh
	2SyV9s9rOS6dRVRPyjwm7J76SW0nkhSv8nRe38EZEJTjDIdrzbilJWlHzzZiJldl
	RhXCCtaAIb3y4bUCpTBs/TjeFVj1IpFlw4M9Q00vOkxmy7hRE+usqHJmvylJcY1O
	3CURlrjNRNAtK6UUN3/jg==
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06;
	repo=github.com/dkim2wg/interop; date=2026-10-04; sw=lmtpprox;
	action=sign d=pobox.com a=rsa-sha256;
X-DKIM2-Signature: i=1; m=1; t=1791393815; d=pobox.com;
	mf=PGdpdHN0ZXJAcG9ib3guY29tPg==;
	rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+;
	s=fm1:rsa-sha256:KIWzJOTF6jpgZcwvykxhoPUnGtjV5zvof+yfWhMuZL0hEol
	9PYeqmTgrNeTDte1AbsEUVfEifrs6A8Ek/cMV2HgcZvWlYNhMDDqCDyUEKRrWwxL
	57Smn9/jtxrmDMiNIx99sUtWBYccvLwn/oWdjWalb/DKXaJXvgt7e3qAQjIlgLvh
	LD+mDq6dqbJD/deERXZpUDe0k4AUNvPuKK6Pkoy5VJJEHENNuFzwtinjDaKATVUM
	pWr3K/aUzTT0bF5LQ1KcvLbid6gxw/hpsXd/IG/LxUdqNDbKJ5IurzI+S2tD45R6
	IudPtHx7tAFYWIS+SDcGjclo5vvUXjncAiE9pBA==;
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06;
	repo=github.com/dkim2wg/interop; date=2026-10-04; sw=lmtpprox;
	action=mi-m=1; hc=13;
	hn=cc,content-transfer-encoding,content-type,date,feedback-id,
	from,in-reply-to,message-id,mime-version,references,subject,to,
	user-agent;
X-Message-Instance: m=1; h=sha256:8zOq75756kIl7iLKFIPRV9nEy4VyiwG0XgAtso/Ryjo=:34Y2pg4DngiFfkG1kptkGhv0GlQuddEi3RK8Zpu8Ln4=;
X-ME-Sender: <xms:F4DGasJowYEoRjvZh3waOB-DqXpDeAAq0Do4zCr07yCxP8N2xJDZWQ>
    <xme:F4DGajneIYSqhHNq8i39nur8ogVFm3VhcJRJOEZRaw-9iaOnRg5VoJmBXRhFKbhxj
    nR1gsc5xDFd5tiNiCPy3YFRu-iQkzJBPhmur4J3osfvvLsfda-tlQ>
X-ME-Received: <xmr:F4DGaqHcHC_ymL1Y0B5vrX_64_Y9157aecuGGYfHdun_MiwXFf67ErLrLeOgS1ZFtLhILShxuSojsQ-hTw2ZNbTG9SO6g0ade3QG>
X-ME-Proxy-Cause: dmFkZTFoIMzLxtAASLvWLtHR09RiW/uPY9r8apOGlI9eKeiIdsXvQpM7w1VfEhivKAkqb8
    wHs10r9Q/UivsfoRUhp2Psib1mXKCUNglGen7r9v1vlP4soBRhzu1JI7sxbiHLO0Ah9Chb
    JSvtkonsceZEeLpjE35XSRoTTs04kkasQ4PlK6S0bOxYKx27ENaEW452XJcrx/vfGEEZWJ
    PzRVmSZsWqk6g+vthh6QCuUKOerc19nrygzlZugBf1PU80hqKmzfvkxubZvYffIDzaE5EG
    PVwGaQhvGALNl3v2gGu5nhMl4uTR0rTyVkC9JoMn2K+dn1YNLuRF1iDL9FBNUNJ8/XadTf
    Gb5kJ6QNp92HBV/HQtpSxXGRtX0v978ihAbwWsQfMUcrjezedawavv0r/7gT/pqUEzncCu
    z4T1t6yjnnx7rx/wcm7yRECpDlzCkkdM0hUITBev3w04FrB9qZy3/yjLvOvVnPZBai2m8L
    df8K4SR1teUmuA36EFXcp3oJCCZY2mYjV6G73CSe73hUS7ii0yONPhdiaQwHDD9hjCW8Ij
    aO/WaCpDSQKQq9n3QVbkbVpaQ8ZFg2w8ueT5eKzJe8Y1fi3TGJwZd2cOQgHcruindW3bmy
    q4yjib+9tTvyIY2ZWD3tqkjf4l8oYo7tXr3y34MF47CII5h6l927fmGbCDEw
X-ME-Proxy: <xmx:F4DGajEauejMjsGdSFXIq6yA-F2NcSY9-8ILz4dyAgGmkRcMnLuc-A>
    <xmx:F4DGanOo5XGMa8L0d_RTH-DHtA2iVxGtydm67jG-qWNSu8iPpPwMyg>
    <xmx:F4DGaiGMteIb_QV9ghSDwy0XJZOgdTE8g1xdGnC0du21WYGADIJ-qA>
    <xmx:F4DGauNZcd0WGotYZpGa0VS9XLnpWhbjHnHntZoOmRMltGKdlBUZmg>
    <xmx:F4DGakPnIlAKMdz8_dCF5LI2Fdx83hiOLYVp9rfrz-w278U4xiK_uXH0>
X-Feedback-ID: if26b431b:Fastmail
X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed,
 7 Oct 2026 13:23:34 -0400 (EDT)
X-Cc: git@vger.kernel.org
X-In-Reply-To: <20260929112544.86511-1-scott@gitbutler.net> (Scott Chacon's
	message of "Tue, 29 Sep 2026 13:25:40 +0200")
X-User-Agent: Gnus/5.13 (Gnus v5.13)
X-Precedence: bulk
X-Mailing-List: git@vger.kernel.org
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>