Skip to content

Commit c992a92

Browse files
author
Bryan Lawrence
committed
fixed axis flow diagram
1 parent dc92ebf commit c992a92

File tree

1 file changed

+45
-44
lines changed

1 file changed

+45
-44
lines changed

docs4understanding/axis_flow_v1.puml

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@startuml axis_flow_v1
22

3-
title "Axis Parameter Flow Through Reduction Pipeline"
3+
title "Axis Parameter Flow Through Reduction Pipeline (Path-Specific)"
44

55
actor User
66

@@ -9,7 +9,10 @@ participant "Active\n._get_selection()" as GetSelection
99
participant "Active\n._from_storage()" as FromStorage
1010
participant "ExecutionStrategy\n.execute()" as Strategy
1111
participant "ChunkedLocalStrategy\n.execute()" as LocalStrat
12-
participant "StorageBackend\n.reduce_chunk()" as Backend
12+
participant "ChunkedRemoteStrategy\n.execute()" as RemoteStrat
13+
participant "WholeArrayStrategy\n.execute()" as WholeStrat
14+
participant "StorageBackend\n.reduce_chunk()" as ChunkBackend
15+
participant "StorageBackend\n.reduce_selection()" as SelBackend
1316
participant "Reductionist\nv2 API" as Reductionist
1417

1518
User ->> Active: active.mean(axis=0)[:]
@@ -32,48 +35,46 @@ GetSelection ->> FromStorage: _from_storage(..., axis=axis)
3235

3336
FromStorage ->> Strategy: strategy.execute(\n ..., axis=axis)
3437

35-
note over Strategy
36-
For ChunkedLocalStrategy:
37-
- iterate chunks
38-
- create ChunkRequest(axis=axis)
39-
- for S3/HTTPS: pass axis to backend
40-
end note
41-
42-
Strategy ->> LocalStrat: ChunkedLocalStrategy\n.execute(..., axis=axis)
43-
44-
LocalStrat ->> LocalStrat: for chunk in chunks:\n ChunkRequest(axis=axis)
45-
46-
LocalStrat ->> Backend: reduce_chunk(request)
47-
48-
note over Backend
49-
S3Backend / HttpsBackend:
50-
- Extract axis from request
51-
- Pass axis=request.axis
52-
to reductionist API
53-
end note
54-
55-
Backend ->> Reductionist: reduce_chunk(\n ...\n axis=request.axis,\n operation='mean')
56-
57-
note over Reductionist
58-
Reductionist v2 API:
59-
- Receives axis tuple
60-
- Performs axis-aware reduction
61-
- Returns reduced chunk
62-
- Example:
63-
axis=(0,1) → shape[2] result
64-
axis=(2,) → shape[0,1] result
65-
axis=None → scalar result
66-
end note
67-
68-
Reductionist ->> Backend: ChunkResult(\n data=reduced_chunk)
69-
70-
Backend ->> LocalStrat: ChunkResult
71-
72-
LocalStrat ->> LocalStrat: Accumulate results by axis
73-
74-
LocalStrat ->> LocalStrat: Apply final reduction\n if needed
75-
76-
LocalStrat ->> FromStorage: final_result
38+
alt Local chunked path (LocalBackend + ChunkedLocalStrategy)
39+
Strategy ->> LocalStrat: execute(..., axis=axis)
40+
LocalStrat ->> LocalStrat: for chunk in indexer:\nChunkRequest(axis=axis)
41+
LocalStrat ->> ChunkBackend: reduce_chunk(request)
42+
ChunkBackend -->> LocalStrat: ChunkResult(data, count)
43+
LocalStrat ->> LocalStrat: accumulate chunk outputs\nand finalize reduction
44+
LocalStrat -->> FromStorage: final_result
45+
else Remote chunked path (S3/Https + ChunkedRemoteStrategy)
46+
Strategy ->> RemoteStrat: execute(..., axis=axis)
47+
RemoteStrat ->> RemoteStrat: for chunk in indexer:\nChunkRequest(axis=axis)
48+
RemoteStrat ->> ChunkBackend: reduce_chunk(request)
49+
50+
note over ChunkBackend
51+
S3Backend / HttpsBackend:
52+
passes axis=request.axis
53+
to Reductionist v2 API
54+
end note
55+
56+
ChunkBackend ->> Reductionist: reduce_chunk(\n..., axis=request.axis, operation='mean')
57+
58+
note over Reductionist
59+
Reductionist v2 API:
60+
- axis tuple is applied server-side
61+
- returns per-chunk reduced result
62+
- examples:
63+
axis=(0,1) -> shape[2]
64+
axis=(2,) -> shape[0,1]
65+
axis=None -> scalar
66+
end note
67+
68+
Reductionist -->> ChunkBackend: ChunkResult(data, count)
69+
ChunkBackend -->> RemoteStrat: ChunkResult(data, count)
70+
RemoteStrat ->> RemoteStrat: accumulate chunk outputs\nand finalize reduction
71+
RemoteStrat -->> FromStorage: final_result
72+
else Whole-array path (P5Rem + WholeArrayStrategy)
73+
Strategy ->> WholeStrat: execute(..., axis=axis)
74+
WholeStrat ->> SelBackend: reduce_selection(SelectionRequest(axis=axis))
75+
SelBackend -->> WholeStrat: SelectionResult(data, n)
76+
WholeStrat -->> FromStorage: final_result
77+
end
7778

7879
FromStorage ->> GetSelection: final_result
7980

0 commit comments

Comments
 (0)