compact8.go ×2

Frontier kind: Joint frontier

unlabeled · c_76c7db760bc9

5 tests · 39 LOC · 1 file · introduces 1 test · 10 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
2 ranges10 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
11 ranges39 lines · 1 file · Browse complete extent
All tests (intent)
5 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Introduced files, introduced tests, and structurally relevant concept specializationTestDrainClearsBacklogBits · 0 introduced LOCTestDrainClearsBacklogBi…TestBacklogCountUpdateInMemoryOnly · 0 introduced LOCTestBacklogCountUpdateIn…TestUpdateZeroBoundary · 0 introduced LOCTestUpdateZeroBoundarycompact8.go ×1 · 1 introduced LOCcompact8.go ×1TestEncodeRoundsDown · 0 introduced LOCTestEncodeRoundsDowncompact8.go ×2 · 4 introduced LOCcompact8.go ×2compact8.go ×1 · 1 introduced LOCcompact8.go ×1compact8.go ×2 · 14 introduced LOCcompact8.go ×2compact8.go ×1 · 3 introduced LOCcompact8.go ×1compact8.go ×2 · 5 introduced LOCcompact8.go ×2compact8.go ×1 · 2 introduced LOCcompact8.go ×1TestOperatorServiceMetadata, TestWorkflowServiceMetadata · 0 introduced LOCTestOperatorServiceMetad…go.temporal.io/server/common/number/compact8.go · 98 LOCnumber/compact8.goTestOperatorServiceMetadata · introduced test · go.temporal.io/server/common/api/TestOperatorServiceMetadataTestOperatorServiceMetad…TestWorkflowServiceMetadata · introduced test · go.temporal.io/server/common/api/TestWorkflowServiceMetadataTestWorkflowServiceMetad…TestEncodeRoundsDown · introduced test · go.temporal.io/server/common/number/TestCompact8Suite/TestEncodeRoundsDownTestEncodeRoundsDownTestUpdateHysteresis · introduced test · go.temporal.io/server/common/number/TestCompact8Suite/TestUpdateHysteresisTestUpdateHysteresisTestUpdateLargeJump · introduced test · go.temporal.io/server/common/number/TestCompact8Suite/TestUpdateLargeJumpTestUpdateLargeJumpTestUpdateZeroBoundary · introduced test · go.temporal.io/server/common/number/TestCompact8Suite/TestUpdateZeroBoundaryTestUpdateZeroBoundaryTestBacklogCountUpdateInMemoryOnly · introduced test · go.temporal.io/server/service/matching/TestScaleManagerSuite/TestBacklogCountUpdateInMemoryOnlyTestBacklogCountUpdateIn…TestDrainClearsBacklogBits · introduced test · go.temporal.io/server/service/matching/TestScaleManagerSuite/TestDrainClearsBacklogBitsTestDrainClearsBacklogBi…Focused concept · compact8.go ×2 · 10 introduced LOCcompact8.go ×2

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 10 introduced LOC across 2 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/number/compact8.go 10 introduced LOC · 2 ranges

Open complete file

81 return prev
82 }
83 > newDist := value - DecodeCompact8(newCode) // always >= 0 (round-down) compact8.go
84 > oldDist := DecodeCompact8(prev) - value
85 > if oldDist < 0 {
86 > oldDist = -oldDist
87 > }
88 // Require the new code to be closer by at least half a bucket width
89 // (at the smaller of the two exponent levels). This shifts the
90 // transition point from the midpoint to the 3/4 mark of the gap,
91 // creating a dead zone that prevents chatter.
92 > e := max(1, min(int(prev/12), int(newCode/12))) compact8.go
93 > margin := int64(1) << (e + compact8offset - 1)
94 > if newDist < oldDist-margin {
95 > return newCode
96 > }
97 return prev
98 }