[sparkplug+] Support embedded feedback for Equal and Relational Comparison Operations [v8/v8 : main]

0 views
Skip to first unread message

Wei, Yuheng (Gerrit)

unread,
Jan 28, 2026, 12:43:08 AM (7 days ago) Jan 28
to Toon Verwaest, Leszek Swirski, chrom...@appspot.gserviceaccount.com, V8 LUCI CQ, Xu, Hao A, dmercadi...@chromium.org, leszek...@chromium.org, marja...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Leszek Swirski and Toon Verwaest

Wei, Yuheng added 1 comment

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Wei, Yuheng . resolved

This patch is ready for review, PTAL!

Open in Gerrit

Related details

Attention is currently required from:
  • Leszek Swirski
  • Toon Verwaest
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I7524cabd856b55a319dc694a48ecb17e3261e33b
Gerrit-Change-Number: 7501090
Gerrit-PatchSet: 5
Gerrit-Owner: Wei, Yuheng <yuhen...@intel.com>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-Reviewer: Wei, Yuheng <yuhen...@intel.com>
Gerrit-CC: Xu, Hao A <hao....@intel.com>
Gerrit-Attention: Toon Verwaest <verw...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Wed, 28 Jan 2026 05:43:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Toon Verwaest (Gerrit)

unread,
Jan 30, 2026, 8:34:20 AM (5 days ago) Jan 30
to Wei, Yuheng, Leszek Swirski, chrom...@appspot.gserviceaccount.com, V8 LUCI CQ, Xu, Hao A, dmercadi...@chromium.org, leszek...@chromium.org, marja...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Leszek Swirski and Wei, Yuheng

Toon Verwaest voted and added 1 comment

Votes added by Toon Verwaest

Code-Review+1

1 comment

File test/unittests/interpreter/bytecode_expectations/BasicLoops.golden
Line 395, Patchset 5 (Latest):bytecode array length: 34
Toon Verwaest . unresolved

Not for this cl, but I was wondering if we could replace bitwise or with a table mapping from one combined feedback indicator to the next, based on observed inputs. E.g. combined_feedback = table[combined_feedback][new_feedback]. That way we could probably encode the embedded feedback into 1 byte instead of 2? I presume the perf diff is negligible.

Open in Gerrit

Related details

Attention is currently required from:
  • Leszek Swirski
  • Wei, Yuheng
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I7524cabd856b55a319dc694a48ecb17e3261e33b
Gerrit-Change-Number: 7501090
Gerrit-PatchSet: 5
Gerrit-Owner: Wei, Yuheng <yuhen...@intel.com>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-Reviewer: Wei, Yuheng <yuhen...@intel.com>
Gerrit-CC: Xu, Hao A <hao....@intel.com>
Gerrit-Attention: Wei, Yuheng <yuhen...@intel.com>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Fri, 30 Jan 2026 13:34:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Wei, Yuheng (Gerrit)

unread,
Feb 2, 2026, 12:50:04 AM (2 days ago) Feb 2
to Toon Verwaest, Leszek Swirski, chrom...@appspot.gserviceaccount.com, V8 LUCI CQ, Xu, Hao A, dmercadi...@chromium.org, leszek...@chromium.org, marja...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Leszek Swirski, Toon Verwaest and Xu, Hao A

Wei, Yuheng added 2 comments

Patchset-level comments
Wei, Yuheng . resolved

Hi Leszek, please also take a look :)

File test/unittests/interpreter/bytecode_expectations/BasicLoops.golden
Line 395, Patchset 5 (Latest):bytecode array length: 34
Toon Verwaest . unresolved

Not for this cl, but I was wondering if we could replace bitwise or with a table mapping from one combined feedback indicator to the next, based on observed inputs. E.g. combined_feedback = table[combined_feedback][new_feedback]. That way we could probably encode the embedded feedback into 1 byte instead of 2? I presume the perf diff is negligible.

Wei, Yuheng

Shrinking the embedded feedback into 8 bits would avoid possible unaligned 16-bit r/w, and I think this will offer a slight perf benefit.

IIUC, although compare op feedback currently use 10 bits one-hot encoding ([link](https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=8f35dec9947f2b0c21c18f68eba49154a26f6430;l=2444)), the **meaningful** states are not so much. We could use a 8 bits `state` to track states that are valuable to the optimizers, and leave those meaningless states (for example `kString | kSymbol`) in `kAny`. Then we can have feedback update like `new_state` = table[`old_state`][`input_type`].

Compare ops as an example, there are ~17 named feedback types. We would essentially need a 17x17 state transition map and a decoding table that are shared across sparkplug, maglev and tf.

Open in Gerrit

Related details

Attention is currently required from:
  • Leszek Swirski
  • Toon Verwaest
  • Xu, Hao A
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I7524cabd856b55a319dc694a48ecb17e3261e33b
Gerrit-Change-Number: 7501090
Gerrit-PatchSet: 5
Gerrit-Owner: Wei, Yuheng <yuhen...@intel.com>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-Reviewer: Wei, Yuheng <yuhen...@intel.com>
Gerrit-CC: Xu, Hao A <hao....@intel.com>
Gerrit-Attention: Toon Verwaest <verw...@chromium.org>
Gerrit-Attention: Xu, Hao A <hao....@intel.com>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Mon, 02 Feb 2026 05:50:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Leszek Swirski (Gerrit)

unread,
Feb 3, 2026, 6:41:48 AM (22 hours ago) Feb 3
to Wei, Yuheng, Toon Verwaest, chrom...@appspot.gserviceaccount.com, V8 LUCI CQ, Xu, Hao A, dmercadi...@chromium.org, leszek...@chromium.org, marja...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Toon Verwaest, Wei, Yuheng and Xu, Hao A

Leszek Swirski voted and added 1 comment

Votes added by Leszek Swirski

Code-Review+1

1 comment

Patchset-level comments
Leszek Swirski . resolved

Looks good thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Toon Verwaest
  • Wei, Yuheng
  • Xu, Hao A
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I7524cabd856b55a319dc694a48ecb17e3261e33b
Gerrit-Change-Number: 7501090
Gerrit-PatchSet: 5
Gerrit-Owner: Wei, Yuheng <yuhen...@intel.com>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-Reviewer: Wei, Yuheng <yuhen...@intel.com>
Gerrit-CC: Xu, Hao A <hao....@intel.com>
Gerrit-Attention: Toon Verwaest <verw...@chromium.org>
Gerrit-Attention: Wei, Yuheng <yuhen...@intel.com>
Gerrit-Attention: Xu, Hao A <hao....@intel.com>
Gerrit-Comment-Date: Tue, 03 Feb 2026 11:41:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Toon Verwaest (Gerrit)

unread,
Feb 3, 2026, 8:11:25 AM (20 hours ago) Feb 3
to Wei, Yuheng, Leszek Swirski, chrom...@appspot.gserviceaccount.com, V8 LUCI CQ, Xu, Hao A, dmercadi...@chromium.org, leszek...@chromium.org, marja...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Wei, Yuheng and Xu, Hao A

Toon Verwaest added 1 comment

File test/unittests/interpreter/bytecode_expectations/BasicLoops.golden
Line 395, Patchset 5 (Latest):bytecode array length: 34
Toon Verwaest . unresolved

Not for this cl, but I was wondering if we could replace bitwise or with a table mapping from one combined feedback indicator to the next, based on observed inputs. E.g. combined_feedback = table[combined_feedback][new_feedback]. That way we could probably encode the embedded feedback into 1 byte instead of 2? I presume the perf diff is negligible.

Wei, Yuheng

Shrinking the embedded feedback into 8 bits would avoid possible unaligned 16-bit r/w, and I think this will offer a slight perf benefit.

IIUC, although compare op feedback currently use 10 bits one-hot encoding ([link](https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=8f35dec9947f2b0c21c18f68eba49154a26f6430;l=2444)), the **meaningful** states are not so much. We could use a 8 bits `state` to track states that are valuable to the optimizers, and leave those meaningless states (for example `kString | kSymbol`) in `kAny`. Then we can have feedback update like `new_state` = table[`old_state`][`input_type`].

Compare ops as an example, there are ~17 named feedback types. We would essentially need a 17x17 state transition map and a decoding table that are shared across sparkplug, maglev and tf.

Toon Verwaest

I we just have a transition map then the total number of states should be < 256 either way? I think it would be nice to avoid the cross-cacheline writes.

Open in Gerrit

Related details

Attention is currently required from:
  • Wei, Yuheng
  • Xu, Hao A
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I7524cabd856b55a319dc694a48ecb17e3261e33b
Gerrit-Change-Number: 7501090
Gerrit-PatchSet: 5
Gerrit-Owner: Wei, Yuheng <yuhen...@intel.com>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-Reviewer: Wei, Yuheng <yuhen...@intel.com>
Gerrit-CC: Xu, Hao A <hao....@intel.com>
Gerrit-Attention: Wei, Yuheng <yuhen...@intel.com>
Gerrit-Attention: Xu, Hao A <hao....@intel.com>
Gerrit-Comment-Date: Tue, 03 Feb 2026 13:11:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
Comment-In-Reply-To: Wei, Yuheng <yuhen...@intel.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Wei, Yuheng (Gerrit)

unread,
Feb 3, 2026, 9:53:10 PM (6 hours ago) Feb 3
to Leszek Swirski, Toon Verwaest, chrom...@appspot.gserviceaccount.com, V8 LUCI CQ, Xu, Hao A, dmercadi...@chromium.org, leszek...@chromium.org, marja...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Xu, Hao A

Wei, Yuheng voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Xu, Hao A
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I7524cabd856b55a319dc694a48ecb17e3261e33b
Gerrit-Change-Number: 7501090
Gerrit-PatchSet: 5
Gerrit-Owner: Wei, Yuheng <yuhen...@intel.com>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-Reviewer: Wei, Yuheng <yuhen...@intel.com>
Gerrit-CC: Xu, Hao A <hao....@intel.com>
Gerrit-Attention: Xu, Hao A <hao....@intel.com>
Gerrit-Comment-Date: Wed, 04 Feb 2026 02:53:06 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Wei, Yuheng (Gerrit)

unread,
Feb 3, 2026, 9:53:54 PM (6 hours ago) Feb 3
to Leszek Swirski, Toon Verwaest, chrom...@appspot.gserviceaccount.com, V8 LUCI CQ, Xu, Hao A, dmercadi...@chromium.org, leszek...@chromium.org, marja...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Xu, Hao A

Wei, Yuheng removed a vote from this change

Removed Code-Review+1 by Wei, Yuheng <yuhen...@intel.com>
Open in Gerrit

Related details

Attention is currently required from:
  • Xu, Hao A
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: deleteVote
satisfied_requirement
unsatisfied_requirement
open
diffy

Wei, Yuheng (Gerrit)

unread,
Feb 3, 2026, 10:11:47 PM (6 hours ago) Feb 3
to Leszek Swirski, Toon Verwaest, chrom...@appspot.gserviceaccount.com, V8 LUCI CQ, Xu, Hao A, dmercadi...@chromium.org, leszek...@chromium.org, marja...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Toon Verwaest and Xu, Hao A

Wei, Yuheng added 1 comment

File test/unittests/interpreter/bytecode_expectations/BasicLoops.golden
Line 395, Patchset 5 (Latest):bytecode array length: 34
Toon Verwaest . unresolved

Not for this cl, but I was wondering if we could replace bitwise or with a table mapping from one combined feedback indicator to the next, based on observed inputs. E.g. combined_feedback = table[combined_feedback][new_feedback]. That way we could probably encode the embedded feedback into 1 byte instead of 2? I presume the perf diff is negligible.

Wei, Yuheng

Shrinking the embedded feedback into 8 bits would avoid possible unaligned 16-bit r/w, and I think this will offer a slight perf benefit.

IIUC, although compare op feedback currently use 10 bits one-hot encoding ([link](https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=8f35dec9947f2b0c21c18f68eba49154a26f6430;l=2444)), the **meaningful** states are not so much. We could use a 8 bits `state` to track states that are valuable to the optimizers, and leave those meaningless states (for example `kString | kSymbol`) in `kAny`. Then we can have feedback update like `new_state` = table[`old_state`][`input_type`].

Compare ops as an example, there are ~17 named feedback types. We would essentially need a 17x17 state transition map and a decoding table that are shared across sparkplug, maglev and tf.

Toon Verwaest

I we just have a transition map then the total number of states should be < 256 either way? I think it would be nice to avoid the cross-cacheline writes.

Wei, Yuheng

Yes. Since the total number of meaningful states is well under 256, 1 byte embedded feedback is enough. If this sounds good to you I can draft a follow-up CL later :)

Open in Gerrit

Related details

Attention is currently required from:
  • Toon Verwaest
  • Xu, Hao A
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I7524cabd856b55a319dc694a48ecb17e3261e33b
Gerrit-Change-Number: 7501090
Gerrit-PatchSet: 5
Gerrit-Owner: Wei, Yuheng <yuhen...@intel.com>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-Reviewer: Wei, Yuheng <yuhen...@intel.com>
Gerrit-CC: Xu, Hao A <hao....@intel.com>
Gerrit-Attention: Toon Verwaest <verw...@chromium.org>
Gerrit-Attention: Xu, Hao A <hao....@intel.com>
Gerrit-Comment-Date: Wed, 04 Feb 2026 03:11:44 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages